9.2.1 Mapping of elementary data types

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)

DataType
NodeID

OPC UA

built in data types

PLCopen specific OPC UA simple data type definitions Comment
1BOOL / Boolean---Boolean (UA:1)-A one bit value (true or false).
2SINT / Short integer---SByte (UA:2)-An 8 bit signed integer value.
3INT / Integer---Int16 (UA:4)-A 16 bit signed integer value.
4DINT---Int32 (UA:6)-A 32 bit signed integer value.
5LINT / Long integer---Int64 (UA:8)-A 64 bit signed integer value.
6USINT / Unsigned short integer---Byte (UA:3)-An 8 bit unsigned integer value.
7UINT / Unsinged integer---UInt16 (UA:5)-A 16 bit unsigned integer value.
8UDINT / Unsigned double integer---UInt32 (UA:7)-A 32 bit unsigned integer value.
9ULINT / Unsigned long integer---UInt64 (UA:9)-A 64 bit unsigned integer value.
10REAL / 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.

11LREAL / 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.

12aTIME / Durationx:3005Int64 (UA:8)TIMEThe 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.
12bLTIME / Durationx:3006Int64 (UA:8)LTIMEThe 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).
13aDATE / Date (only)x:3007DateTime (UA:13)DATEThe 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.
13bLDATE / Long date (only)X:3014Int64 (UA:8)LDATEThe 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.
14aTOD
Time of day (only)
x:3008UInt32 (UA:7)TODTOD (TIME_OF_DAY) stores number of milliseconds since the beginning of the day: TOD#00:00:00.000 to TOD#23:59:59.999.
14bLTOD
(Time of day)
x:3009Int64 (UA:8)LTODLTOD (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.
15aDT
Date and time of day
x:3010DateTime (UA:13)DTThe range and resolution of this type is vendor specific.
15bLDT
Date and time of day
x:3015Int64 (UA:8)LDTThe 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
16aSTRING
variable-length single-byte character string
x:3013String (UA:12)STRINGThe 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.
16bWSTRING
variable-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

17aCHAR
single-byte character
x:3011Byte (UA:3)CHARThe 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
17bWCHAR
double-byte character
x:3012UInt16WCHARThe 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.
18BYTE
Bit string of length 8
x:3001ByteBYTEThe 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.
19WORD
Bit string of length 16
x:3002UInt16WORDThe 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
20DWORD
Bit string of length 32

x:3003

UInt32DWORDThe 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
21LWORD
Bit string of length 64
x:3004UInt64LWORDThe 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