Errata exists for this version of the document.
This structure contains information about the EngineeringUnits. Its elements are defined in Table 16.
Table 16 – EUInformation DataType structure
Name |
Type |
Description |
EUInformation |
structure |
|
namespaceUri |
String |
Identifies the organization (company, standards organization) that defines the EUInformation. |
unitId |
Int32 |
Identifier for programmatic evaluation. −1 is used if a unitId is not available. |
displayName |
LocalizedText |
The displayName of the engineering unit is typically the abbreviation of the engineering unit, for example ”h” for hour or ”m/s” for meter per second. |
description |
LocalizedText |
Contains the full name of the engineering unit such as ”hour” or ”meter per second”. |
Its representation in the AddressSpace is defined in Table 17
Table 17 – EUInformation definition
Attributes |
Value |
BrowseName |
EUInformation |
To facilitate interoperability, OPC UA specifies how to apply the widely accepted “Codes for Units of Measurement” published by the “United Nations Centre for Trade Facilitation and Electronic Business” (see UN/CEFACT: UNECE Recommendation N° 20). It uses and is based on the International System of Units (SI Units) but in addition provides a fixed code that can be used for automated evaluation. This recommendation has been accepted by many industries on a global basis.
The UNECE recommendation can be found here:
https://www.unece.org/cefact/codesfortrade/codes_index.html
The latest UNECE version (Rev 12. Filename = rec20_Rev12e_2016.xls, published in 2016) is available here:
http://www.unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_Rev12e_2016.xls
The mapping of the UNECE codes to OPC UA (EUInformation.unitId) is available here:
http://www.opcfoundation.org/UA/EngineeringUnits/UNECE/UNECE_to_OPCUA.csv
Table 18 contains a small excerpt of the published Annex with Code Lists:
Table 18 – Examples from the UNECE Recommendation
Excerpt from Recommendation N°. 20, Annex 1 |
|||
Common Code |
Name |
Conversion Factor |
Symbol |
C81 |
radian |
|
rad |
C25 |
milliradian |
10–3 rad |
mrad |
MMT |
millimetre |
10–3 m |
mm |
HMT |
hectometre |
102 m |
hm |
KTM |
kilometre |
103 m |
km |
KMQ |
kilogram per cubic metre |
kg/m3 |
kg/m3 |
FAH |
degree Fahrenheit |
5/9×K |
°F |
J23 |
degree Fahrenheit per hour |
1,543 210 × 10–4 K/s |
°F/h |
Specific columns of this table shall be used to create the EUInformation structure as defined by the following rules:
- The Common Code is represented as an alphanumeric variable length of 3 characters. It shall be used for the EUInformation.unitId. The following pseudo code specifies the algorithm to convert the Common Code into an Int32 as needed for EUInformation.unitId:
Int32 unitId = 0; Int32 c; for (i=0; i<=3;i++) {
c = CommonCode[i]; if (c == 0) break; // end of Common Code unitId = unitId << 8; unitId = unitId | c;}
- The Symbol field shall be copied to the EUInformation.displayName. The localeId field of EUInformation.displayName shall be empty.
- The Name field shall be used for EUInformation.description. If the name is copied, then the localeId field of EUInformation.description shall be empty. If the name is localized then the localeId field shall specify the correct locale.
The EUInformation.namespaceUri shall be http://www.opcfoundation.org/UA/units/un/cefact.
NOTE It will be advantegous to use Recommendation N°. 20 as specified, because it can be programmatically interpreted by generic OPC UA Clients. However, the EUInformation structure has been defined such that other standards bodies can incorporate their engineering unit definitions into OPC UA. If Servers use such an approach then they shall identify this standards body by using a proper namespaceUri in EUInformation.namespaceUri.