Errata exists for this version of the document.
Following is a description of the DataTypes defined in this specification.
DataTypes like String, Boolean, Double or LocalizedText are defined in OPC 10000-3. Their representation is specified in OPC 10000-5.
This structure defines the Range for a value. Its elements are defined in Table 14.
Table 14 – Range DataType structure
Name |
Type |
Description |
Range |
structure |
|
low |
Double |
Lowest value in the range. |
high |
Double |
Highest value in the range. |
If a limit is not known a NaN shall be used.
Its representation in the AddressSpace is defined in Table 15
Table 15 – Range definition
Attributes |
Value |
BrowseName |
Range |
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.
This structure defines float IEEE 32 bits complex value. Its elements are defined in Table 19.
Table 19 – ComplexNumberType DataType structure
Name |
Type |
Description |
ComplexNumberType |
structure |
|
real |
Float |
Value real part |
imaginary |
Float |
Value imaginary part |
Its representation in the AddressSpace is defined in Table 20
Table 20 – ComplexNumberType definition
Attributes |
Value |
BrowseName |
ComplexNumberType |
This structure defines double IEEE 64 bits complex value. Its elements are defined in Table 21.
Table 21 – DoubleComplexNumberType DataType structure
Name |
Type |
Description |
DoubleComplexNumberType |
structure |
|
real |
Double |
Value real part |
imaginary |
Double |
Value imaginary part |
Its representation in the AddressSpace is defined in Table 22.
Table 22 – DoubleComplexNumberType definition
Attributes |
Value |
BrowseName |
DoubleComplexNumberType |
This structure defines the information for auxiliary axis for ArrayItemType Variables.
There are three typical uses of this structure:
- The step between points is constant and can be predicted using the range information and the number of points. In this case, axisSteps can be set to NULL.
- The step between points is not constant, but remains the same for a long period of time (from acquisition to acquisition for example). In this case, axisSteps contains the value of each step on the axis.
- The step between points is not constant and changes at every update. In this case, a type like XYArrayType shall be used and axisSteps is set to NULL.
Its elements are defined in Table 23.
Table 23 – AxisInformation DataType structure
Name |
Type |
Description |
AxisInformation |
structure |
|
engineeringUnits |
EUInformation |
Holds the information about the engineering units for a given axis. |
eURange |
Range |
Limits of the range of the axis |
title |
Localizedtext |
User readable axis title, useful when the units are %, the Title may be “Particle size distribution” |
axisScaleType |
AxisScaleEnumeration |
LINEAR, LOG, LN, defined by AxisSteps |
axisSteps |
Double[] |
Specific value of each axis steps, may be set to “Null” if not used |
When the steps in the axis are constant, axisSteps may be set to “Null” and in this case, the Range limits are used to compute the steps. The number of steps in the axis comes from the parent ArrayItem.ArrayDimensions.
This enumeration identifies on which type of axis the data shall be displayed. Its values are defined in Table 24.
Table 24 – AxisScaleEnumeration values
Value |
Description |
LINEAR_0 |
Linear scale |
LOG_1 |
Log base 10 scale |
LN_2 |
Log base e scale |
Its representation in the AddressSpace is defined in Table 25.
Table 25 – AxisScaleEnumeration definition
Attributes |
Value |
BrowseName |
AxisScaleEnumeration |
This structure defines a physical value relative to a X axis and it is used as the DataType of the Value of XYArrayItemType. For details see 5.3.4.3.
Many devices can produce values that can perfectly be represented with a float IEEE 32 bits but, they can position them on the X axis with an accuracy that requires double IEEE 64 bits. For example, the peak value in an absorbance spectrum where the amplitude of the peak can be represented by a float IEEE 32 bits, but its frequency position required 10 digits which implies the use of a double IEEE 64 bits.
Its elements are defined in Table 26.
Table 26 – XVType DataType structure
Name |
Type |
Description |
XVType |
structure |
|
x |
Double |
Position on the X axis of this value |
value |
Float |
The value itself |
Its representation in the AddressSpace is defined in Table 27.
Attributes |
Value |
BrowseName |
XVType |