The mapping of IEC 61131-3 elementary data types to OPC UA data types is formally defined in Table 27. The OPC UA built in data types are used for the wire representation of the data type. Additional PLCopen specific OPC UA data type definitions are used to provide the special semantic if necessary.
Table 27 – Mapping IEC 61131-3 elementary data types to OPC UA built in data types
No. |
IEC 61131-3 elementary data types (Keyword / Description) |
DataTypeNodeID |
OPC UA built in data types |
PLCopen specific OPC UA simple data type definitions |
Comment |
1 |
BOOL / Boolean |
--- |
Boolean (UA:1) |
- |
A one bit value (true or false). |
2 |
SINT / Short integer |
--- |
SByte (UA:2) |
- |
An 8 bit signed integer value. |
3 |
INT / Integer |
--- |
Int16 (UA:4) |
- |
A 16 bit signed integer value. |
4 |
DINT |
--- |
Int32 (UA:6) |
- |
A 32 bit signed integer value. |
5 |
LINT / Long integer |
--- |
Int64 (UA:8) |
- |
A 64 bit signed integer value. |
6 |
USINT / Unsigned short integer |
--- |
Byte (UA:3) |
- |
An 8 bit unsigned integer value. |
7 |
UINT / Unsinged integer |
--- |
UInt16 (UA:5) |
- |
A 16 bit unsigned integer value. |
8 |
UDINT / Unsigned double integer |
--- |
UInt32 (UA:7) |
- |
A 32 bit unsigned integer value. |
9 |
ULINT / Unsigned long integer |
--- |
UInt64 (UA:9) |
- |
A 64 bit unsigned integer value. |
10 |
REAL / Real numbers |
--- |
Float (UA:10) |
- |
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. |
11 |
LREAL / Long reals |
--- |
Double (UA:11) |
- |
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. |
12a |
TIME / Duration |
x:3005 |
Int64 (UA:8) |
TIME |
The OPC UA simple data type TIME/Duration is derived from the built-in data type Int64. It describes that the type is used as interval of time in milliseconds. The range of valid values is vendor specific. |
12b |
LTIME / Duration |
x:3006 |
Int64 (UA:8) |
LTIME |
The PLCopen simple data type LTIME is derived from the build in data type Int64. It describes that the type is used as interval of time in nanoseconds. The valid range is LT#-106751d23h47m16s854ms775us808ns to LT#+106751d23h47m16s854ms775us807ns. The representation contains information for days (d), hours (h), minutes (m), seconds (s) milliseconds (ms), microseconds (us) and nanoseconds (ns). |
13a |
DATE / Date (only) |
x:3007 |
DateTime (UA:13) |
DATE |
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. |
13b |
LDATE / Long date (only) |
X:3014 |
Int64 (UA:8) |
LDATE |
The PLCopen specific OPC UA simple data type LDATE is derived from the built-in data type Int64. It describes that the type is used as date only. The interval is nanoseconds since 1970-01-01. |
14a |
TOD Time of day (only) |
x:3008 |
UInt32 (UA:7) |
TOD |
TOD (TIME_OF_DAY) stores number of milliseconds since the beginning of the day: TOD#00:00:00.000 to TOD#23:59:59.999. |
14b |
LTOD (Time of day) |
x:3009 |
Int64 (UA:8) |
LTOD |
LTOD (LTIME_OF_DAY) stores the number of nanoseconds since the beginning of the day: LTOD#00:00:00.000000000 to LTOD#23:59:59.999999999. |
15a |
DT Date and time of day |
x:3010 |
DateTime (UA:13) |
DT |
The range and resolution of this type is vendor specific. |
15b |
LDT Date and time of day |
x:3015 |
Int64 (UA:8) |
LDT |
The PLCopen specific OPC UA Simple datatype LDT is derived from the build in data type Int64. It describes the number of nanoseconds elapsed since 1970-01-01-00:00:00 |
16a |
STRINGvariable-length single-byte character string |
x:3013 |
String (UA:12) |
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. |
16b |
WSTRINGvariable-length double-byte character string |
--- |
String (UA:12) |
- |
OPC UA definition: A sequence of UTF8 characters. IEC 61131-3 definition: Variable-length double-byte character string |
17a |
CHARsingle-byte character |
x:3011 |
Byte (UA:3) |
CHAR |
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 |
17b |
WCHARdouble-byte character |
x:3012 |
UInt16 |
WCHAR |
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. |
18 |
BYTEBit string of length 8 |
x:3001 |
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. |
19 |
WORDBit string of length 16 |
x:3002 |
UInt16 |
WORD |
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 |
20 |
DWORDBit string of length 32 |
x:3003
|
UInt32 |
DWORD |
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 |
21 |
LWORDBit string of length 64 |
x:3004 |
UInt64 |
LWORD |
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 |