Supported elementary data types
The following table shows all supported data types throughout the standards.
PLCnext Engineer | C++ | C# | MATLAB® / Simulink® |
OPC UA® | |||
---|---|---|---|---|---|---|---|
IEC 61131-3 languages |
FDCML | Server / Client | PubSub | ||||
1 bit | BOOL | Bit, BOOL, Boolean |
boolean | bool | Boolean | Boolean | Boolean |
8 bit | SINT | SINT, Signed8 |
int8 | sbyte | int8 | SByte | SByte |
USINT | USINT, Unsigned8 |
uint8 | byte | uint8 | Byte | Byte | |
BYTE | BYTE, Bitstring8, BitStringX, Octetstring1, CharASCII, CharISO8859-1 |
||||||
16 bit | INT | INT, Signed16 |
int16 | short | int16 | Int16 | Int16 |
UINT | UINT, Unsigned16 |
uint16 | ushort | uint16 | UInt16 | UInt16 | |
WORD | WORD, Bitstring16, Octetstring2 |
||||||
32 bit | DINT | DINT, Signed32 |
int32 | int | int32 | Int32 | Int32 |
TIME | TIME | Duration (from 2020.3) |
‒ | ||||
UDINT | UDINT, Unsigned32 |
uint32 | uint | uint32 | UInt32 | UInt32 | |
DWORD | DWORD, Bitstring32, Octetstring4 |
||||||
REAL | REAL, Float32 |
float32 | float | single | Float | Float | |
64 bit | LINT | LINT, Signed64 |
int64 | long | ‒ | Int64 | Int64 |
LTIME | LTIME | Duration [4] (from 2020.3) |
‒ | ||||
LTIME_OF_DAY | LTIME_OF_DAY | DateTime (from 2020.3) |
‒ | ||||
‒ | LTOD | DateTime [1] [3] (from 2020.3) |
‒ | ||||
LDATE | LDATE | DateTime [1] [2] (from 2020.3) |
‒ | ||||
LDATE_AND_TIME | LDATE_AND_TIME | DateTime (from 2020.3) |
‒ | ||||
‒ | LDT | DateTime [1] (from 2020.3) |
‒ | ||||
ULINT | ULINT, Unsigned64 |
uint64 | ulong | ‒ | UInt64 | UInt64 | |
LWORD |
LWORD, |
||||||
LREAL | LREAL, Float64 |
float64 | double | double | Double | Double | |
n*8 | STRING | ‒ | StaticString<n> | IecStringEX, IecString80 |
‒ | String (max. 511 bytes)[7] |
‒ |
n*16 | WSTRING [6] (from PLCnext Engineer 2021.3) |
‒ | StaticWString<n> [5] (from firmware and PLCnext CLI 2021.6) |
IecWString, IecWString80 (from firmware 2021.6) |
‒ |
Regarding DateTime
variables with OPC UA® Server/Client:
- Due to the lower time resolution of the OPC UA® data type
DateTime
of 100 ns compared to the resolution of the IEC 61131‑3 data typesLDATE
,LTOD
andLDT
of 1 ns, the values that can be displayed are in the range from1677-09-21T00:12:43.1452243Z
to2262-04-11T23:47:16.8547757Z
. Rounding errors of up to 99 ns occur during reading.
When writing OPC UADateTime
values ≤1677-09-21T00:12:43.1452242Z
or ≥2262-04-11T23:47:16.8547758Z
, it is saturated to the corresponding values.
To indicate underflow or overflow of the value range when reading OPC UA®DateTime
values ≥1677-09-21T00:12:43.1452242Z
or ≤2262-04-11T23:47:16.8547758Z
, these values are mapped to1601-01-01T00:00:00.0000000Z
or to9999-01-01T23:59:59.0000000Z
, respectively, - When writing, the
time
part of OPC UA®DateTime
is also converted according toLDT
. To avoid that thetime
part must be set to00:00:00.0000000
.
When reading, thetime
part is also converted to OPC UA®DateTime
according toLDT
. It may therefore deviate from00:00:00.0000000
. - When writing, the
date
part of OPC UA®DateTime
is also converted according toLDT
. To avoid that thedate
part must be set to1970-01-01
.
When reading, thedate
part is also converted to OPC UA®DateTime
according toLDT
. It may therefore deviate from1970-01-01
. - Due to the conversion of the basic IEC 61131 data type
int64
to OPC UA® data typeDouble
, and the lower time resolution of the OPC UA® data typeDuration
of 1 ms (compared to IEC 61131‑3 data typeLTIME
of 1 ns), the values that can be displayed are in the range from -9223372036854.775 ms to 9223372036854.775 ms. During reading, rounding errors up to 2047 ns occur increasingly towards the edges of the value range.
Regarding String
variables:
- As data types for ports, PLCnext CLI supports StaticWString from PLCnext CLI version 2021.6 on.
- WSTRING is supported from PLCnext Engineer software version 2021.3; not to be confused with StaticWString<n> which is supported from firmware version 2021.6 on.
- See Known Issue:
Known for firmware 2020.3 or newer on all supported PLCnext Control devices:
Access to long
STRING
variables outside the application is limited to 511 bytes. This concerns reading and writing via the RSC servicesIDataAccessService
andISubscriptionService
. These services are used by OPC UA®, PLCnext Engineer HMI and the online functions of PLCnext Engineer, among others.The same applies for
WString
variables (available from firmware 2021.6). Please note thatWString
variables are converted toUTF8
when accessed via RSC services.