OPC UA built-in data types and their PLC counterparts

The 25 built-in types, how DateTime is encoded (100 ns ticks since 1601) and how IEC 61131-3 types map to OPC UA.

Built-in types (OPC 10000-6, table 1)

IdTypeRange / content
1Booleantrue / false
2SByte−128 … 127
3Byte0 … 255
4Int16−32 768 … 32 767
5UInt160 … 65 535
6Int32−2 147 483 648 … 2 147 483 647
7UInt320 … 4 294 967 295
8Int64±9.22·10¹⁸
9UInt640 … 1.84·10¹⁹
10FloatIEEE 754 single
11DoubleIEEE 754 double
12StringUnicode text (UTF-8 on the wire)
13DateTimeInstant in time, UTC
14Guid16-byte identifier
15ByteStringSequence of bytes
16XmlElementXML fragment
17NodeIdNode identifier
18ExpandedNodeIdNodeId with namespace URI / server index
19StatusCode32-bit status
20QualifiedNameNamespace index + name (BrowseName)
21LocalizedTextLocale + text (DisplayName)
22ExtensionObjectEncoded structure (vendor/UDT types)
23DataValueValue + status + source/server timestamps
24VariantAny of the types above, scalar or array
25DiagnosticInfoDetailed error information

The type ids are also the numeric NodeIds of the types in namespace 0: i=11 is Double.

DateTime encoding

A DateTime is a signed 64-bit count of 100-nanosecond intervals since 1601-01-01 00:00 UTC — the same epoch as Windows FILETIME. To convert to Unix time: unix_seconds = ticks / 10 000 000 − 11 644 473 600. Value 0 and Int64 max are special: they mean "earliest" and "latest" representable time and should be treated as invalid. Timestamps are UTC; local time is a display matter. Use the DateTime converter.

PLC types → OPC UA

IEC 61131-3OPC UA
BOOLBoolean
SINT / USINT / BYTESByte / Byte
INT / UINT / WORDInt16 / UInt16
DINT / UDINT / DWORDInt32 / UInt32
LINT / ULINT / LWORDInt64 / UInt64
REAL / LREALFloat / Double
STRING / WSTRINGString
DATE_AND_TIME, DTL, LDTDateTime (vendor-dependent)
STRUCT / UDTExtensionObject of a server-defined DataType

Writes must use exactly the server's data type — writing an Int32 into an Int16 node returns BadTypeMismatch, even if the number fits.

Loading the map…

Sources

  1. OPC 10000-6 Part 6: Mappings (v1.05) — OPC Foundation
  2. OPC 10000-3 Part 3: Address Space Model (v1.05) — OPC Foundation

Updated 2026-10-02