The Open Modular Architecture Controllers (OMAC) Users Group is an industry forum to advance the state of controller technology. More information about OMAC goals and forum participation can be found at the OMAC Web Page. As part of the OMAC forum, an effort is underway to define an open, modular architecture controller specification based on module application programming interfaces (API). The specification effort is under the auspices of the OMAC API working group and an overview of this effort can be found at the OMAC API Web Page. This page describes some exploratory work on mapping STEP 41 definitions for ISO 1000 Measures and Units into MIDL for use within COM components.
Mix up of measurement units is easy to do and can lead to catastrophic results. Meters, millimeters or inches, what’s a designer to do? The classic example of the measurement units mix up occurred when the JPL $125 million Mars Climate Orbiter crashed Sept. 23, 1999 that was primarily blamed on a measurement units mix-up between the navigation design and implementation teams. Mission specifications called for using metric units, but the implementation group sent navigation information in English units. The mix-up meant instead of calculations in newtons (the metric measurement), navigation was done in pounds force (the English unit for measuring thruster impulse). Since one pound force is equivalent to 4.45 newtons, the spacecraft's trajectory was calculated 4.4 times greater than what the navigation team believed.
One step to prevent post mortem finger pointing is to perform the actual measurement calculations with attached units. This can be a little more processor intensive, but with increased processor speed this should not have the impact that it once did. Short of performing all measurement calculations with attached units, one can at least exchange measurement data between systems (such as an operator and a controller) with tagged units. This documentation describes a software package based on the ISO STEP Part 41 standard, to either perform measurement calculations with attached units or exchange measurement data with tagged units. [3] The web site includes some MIDL definitions, C++ source code and Visual Studio projects illustrating the implementation of STEP 41 measures and units as a MIDL specification and implemented with C++ and used as a COM component.
The STEP Part 41 measures and units are represented in Express, a data specification language that is useful for CAD systems to exchange information, but is not directly applicable to C++ or other mainstream programming languages. The translation of Express into IDL for use in COM components is not straightforward. Parsers exist that can generate C code from the STEP Express, but produce volumes of cross-referenced code spaghetti. Thus, the Express was translated by hand into MIDL to allow use as COM components. Related source was developed to show how to use the interfaces. Because MIDL is not as expressive as Express, some semantic information is lost, and the MIDL assumes that the programmer will maintain the semantic information. This software has not been exhaustively tested, but is thought to be worthwhile enough so that it could serve as a starting point for someone with a need to standardize units and measures.
Units
A unit is defined as a physical quantity, with a value of one, which is used as a standard in terms of which other quantities are expressed. The International System of Units, or SI Units, has been adopted by the International Standards Organization as a means to describe physical and other quantities. SI units are currently divided into three classes:
The SI system consists of the seven basic units and other units are derived from them; that is, the product or quotient of any two unit quantities in the system results in another unit quantity. The SI also includes prefixes to form decimal multiples and submultiples of SI units. The SI supplementary units are defined as so-called dimensionless derived units, that is, the _DimensionalExponents are all zero. There are two units in the supplementary class: the radian (or SI unit of the quantity plane angle); and the steradian (or the SI unit of the quantity solid angle).
SI Base Units
The SI is founded on seven SI base units for seven base quantities assumed to be mutually independent, as given in the following table:
|
Quantity |
Unit |
Symbol |
|
Length |
meter |
m |
|
Mass |
kilogram |
kg |
|
Time |
second |
s |
|
Electric current |
ampere |
A |
|
Thermodynamic temperature |
Kelvin |
K |
|
Luminous intensity |
candela |
cd |
|
Molecular substance |
mole |
mol |
The unit dimensionality of any quantity can be expressed as a product of powers of the dimensions of base quantities. These seven base quantities constitute data members of the MIDL _DimensionalExponent struct. IDimensionalExponents is an MIDL interface class that wraps methods around the struct _DimensionalExponent. The implementation includes CDimensionalExponents, which is a class wrapper for manipulating _DimensionalExponent and supporting the methods of IDimensionalExponents COM interface.
Units that are named and _DimensionalExponent values to represent units are considered "NamedUnits." The interface IUnit defines an abstract base class to represent all types of units. IUnit provides unit type definition service. INamedUnit inherits from IUnit and defines an interface to provide services on the name and exponents of a NamedUnit instance.
SI Derived Units
There can be varying types of NamedUnits. Other quantities, called derived quantities, are defined in terms of the seven base quantities via a system of quantity equations. Derived units are expressed algebraically in terms of base units or other derived units (including the radian and steradian which are the two supplementary units.) The SI derived units for these derived quantities are obtained from these equations and the seven SI base units. Examples of such SI derived units are given in Table
|
Quantity |
Unit |
Symbol |
Length |
Mass |
Time |
Electric current |
Thermo- dynamic temperature |
Luminous intensity |
Molecular substance |
Length |
meter |
m |
1.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
|
Mass |
kilogram |
kg |
0.0 |
1.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
|
Time |
second |
s |
0.0 |
0.0 |
1.0 |
0.0 |
0.0 |
0.0 |
0.0 |
|
Electric current |
ampere |
A |
0.0 |
0.0 |
0.0 |
1.0 |
0.0 |
0.0 |
0.0 |
|
Thermodynamic temperature |
Kelvin |
K |
0.0 |
0.0 |
0.0 |
0.0 |
1.0 |
0.0 |
0.0 |
|
Luminous intensity |
candela |
cd |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
1.0 |
0.0 |
|
Molecular substance |
mole |
mol |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
1.0 |
|
Plane angle |
radian |
rad |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
|
Solid angle |
steradian |
sr |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
|
Frequency |
hertz |
Hz (cycle/s) |
0.0 |
0.0 |
-1.0 |
0.0 |
0.0 |
0.0 |
0.0 |
|
Force |
Newton |
N (kg·m/s²) |
1.0 |
1.0 |
-2.0 |
0.0 |
0.0 |
0.0 |
0.0 |
|
Pressure, stress |
Pascal
|
Pa (N/m²) |
-1.0 |
1.0 |
-2.0 |
0.0 |
0.0 |
0.0 |
0.0 |
|
Energy, work, heat quantity |
Joule |
J (N·m) |
2.0 |
1.0 |
-2.0 |
0.0 |
0.0 |
0.0 |
0.0 |
|
Power |
Watt |
W (J/s) |
2.0 |
1.0 |
-3.0 |
0.0 |
0.0 |
0.0 |
0.0 |
|
Electric charge |
Couloumb |
C (A·s) |
0.0 |
0.0 |
1.0 |
1.0 |
0.0 |
0.0 |
0.0 |
|
Electric potential, voltage, electromotive force |
Volt |
V (W/A) |
2.0 |
1.0 |
-3.0 |
-1.0 |
0.0 |
0.0 |
0.0 |
|
Capacitance |
Farad |
F (A·s/V) |
-2.0 |
-1.0 |
4.0 |
2.0 |
0.0 |
0.0 |
0.0 |
|
Resistance |
Ohm |
W=V/A |
2.0 |
1.0 |
-3.0 |
-2.0 |
0.0 |
0.0 |
0.0 |
|
Conductance |
Siemens |
S=A/V |
-2.0 |
-1.0 |
3.0 |
2.0 |
0.0 |
0.0 |
0.0 |
|
Magnetic flux |
Weber |
Wb (V·s) |
2.0 |
1.0 |
-2.0 |
-1.0 |
0.0 |
0.0 |
0.0 |
|
Magnetic flux density |
Telsa |
T (Wb/m²) |
0.0 |
1.0 |
-2.0 |
-1.0 |
0.0 |
0.0 |
0.0 |
|
Inductance |
Henry |
H=V·s/A |
2.0 |
1.0 |
-2.0 |
-2.0 |
0.0 |
0.0 |
0.0 |
|
Temperature |
Celsius |
°C |
0.0 |
0.0 |
0.0 |
0.0 |
1.0 |
0.0 |
0.0 |
|
Luminous flux |
Lumen |
lm (cd·sr) |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
1.0 |
0.0 |
|
Illumination |
Lux |
lx (lm/m²) |
-2.0 |
0.0 |
0.0 |
0.0 |
0.0 |
1.0 |
0.0 |
|
Activity (ionizing radiations) |
Becquerel |
Bq |
0.0 |
0.0 |
-1.0 |
0.0 |
0.0 |
0.0 |
0.0 |
|
Absorbed dose |
Gray |
Gy |
2.0 |
0.0 |
-2.0 |
0.0 |
0.0 |
0.0 |
0.0 |
|
Rays |
Sievert |
Sv |
2.0 |
0.0 |
-2.0 |
0.0 |
0.0 |