Annex C DataType (Non-Normative) ToC Previous

C.1 Mapping of elementary data types ToC Previous Next

The mapping of IEC 61131-3 elementary data types to OPC UA data types is formally defined in OPC 30000 (PLCOpen companion specification). Table 74 is copied from that specification as a reference, any differences with OPC 30000 indicate that this specification is out of date.

Table 74 – Mapping IEC 61131-3 elementary data types to OPC UA built in data types

IEC 61131-3 elementary data types OPC UA built in data types Comment
BOOL Boolean A one bit value (true or false).
SINT SByte An 8 bit signed integer value.
USINT Byte An 8 bit unsigned integer value.
INT Int16 A 16 bit signed integer value.
UINT UInt16 A 16 bit unsigned integer value.
DINT Int32 A 32 bit signed integer value.
UDINT UInt32 A 32 bit unsigned integer value.
LINT Int64 A 64 bit signed integer value.
ULINT UInt64 A 64 bit unsigned integer value.
BYTE Byte The PLC open specific OPC UA simple data type BYTE is derived from the built in data type Byte. It describes that the type is used as bit string of length 8.
WORD UInt16 The PLC open specific OPC UA simple data type WORD is derived from the built in data type UInt16. It describes that the type is used as bit string of length 16
DWORD UInt32 The PLC open specific OPC UA simple data type DWORD is derived from the built in data type UInt32. It describes that the type is used as bit string of length 32
LWORD UInt64 The PLC open specific OPC UA simple data type LWORD is derived from the built in data type UInt64. It describes that the type is used as bit string of length 64
REAL Float OPC UA definition: An IEEE-754 single precision (32 bit) floating point value.
IEC 61131-3 definition: Real (32 bit) with a range of values as defined in IEC 60559 for the basic single width floating-point format.
Both standards are identical.
LREAL Double OPC UA definition: An IEEE-754 double precision (64 bit) floating point value.
IEC 61131-3 definition: Long real (64 bit) with a range of values as defined in IEC 60559 for the basic double width floating-point format.
Both standards are identical.
STRING String The PLC open specific OPC UA simple data type STRING is derived from the built in data type String. It describes that the type is used as a variable-length single-byte character string.
CHAR Byte The PLC open specific OPC UA simple data type CHAR is derived from the built in data type Byte. It describes that the type is used as single-byte character
WSTRING String OPC UA definition: A sequence of UTF8 characters.
IEC 61131-3 definition: Variable-length double-byte character string
WCHAR UInt16 The PLC open specific OPC UA simple data type WCHAR is derived from the built in data type UInt16. It describes that the type is used as double-byte character.
DT DATE_AND_TIME DateTime OPC UA definition: A 64-bit signed integer which represents the number of 100 nanosecond intervals since January 1, 1601.
IEC 61131-3 definition: Date and time of day.
DATE DateTime The PLC open specific OPC UA simple data type DATE is derived from the built in data type DateTime. It describes that the type is used as a date only.
TOD TIME_OF_DAY DateTime The PLC open specific OPC UA simple data type TOD is derived from the built in data type DateTime. It describes that the type is used as time of day only.
TIME Double
The OPC UA simple data type Duration is derived from the built in data type Double. It describes that the type is used as interval of time in milliseconds.

Previous Next