Supported elementary data types

The following table shows all supported data types throughout the standards. 

Note:
  • All these data types can be used in a one-dimensional array.
  • All these data types but arrays can be used a structure.
  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,
Bitstring64,
Octetstring8

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)

 Note:

Regarding DateTime variables with OPC UA® Server/Client:

  1. 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 types LDATE, LTOD and LDT of 1 ns, the values that can be displayed are in the range from 1677-09-21T00:12:43.1452243Z to 2262-04-11T23:47:16.8547757Z. Rounding errors of up to 99 ns occur during reading.
    When writing OPC UA DateTime 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 to 1601-01-01T00:00:00.0000000Z or to 9999-01-01T23:59:59.0000000Z, respectively,
  2. When writing, the time part of OPC UA® DateTime is also converted according to LDT. To avoid that the time part must be set to 00:00:00.0000000.
    When reading, the time part is also converted to OPC UA® DateTime according to LDT. It may therefore deviate from 00:00:00.0000000.
  3. When writing, the date part of OPC UA® DateTime is also converted according to LDT. To avoid that the date part must be set to 1970-01-01.
    When reading, the date part is also converted to OPC UA® DateTime according to LDT. It may therefore deviate from 1970-01-01.
  4. Due to the conversion of the basic IEC 61131 data type int64 to OPC UA® data type Double, and the lower time resolution of the OPC UA® data type Duration of 1 ms (compared to IEC 61131‑3 data type LTIME 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:

  1. As data types for ports, PLCnext CLI supports StaticWString from PLCnext CLI version 2021.6 on.
  2. 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.
  3. 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 services IDataAccessService and ISubscriptionService. 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 that WString variables are converted to UTF8 when accessed via RSC services.

 

 

 


• Published/reviewed: 2024-12-19  ☃  Revision 076 •