Supported data types in C#

The following table illustrates how the IEC 61131-3 data types are linked to the .Net framework and to C#, respectively.

Note: Variables of data types that are marked with a “+” in the Attribute column must have the (otherwise optional) attribute DataType for unambiguous assignment.

IEC 61131-3 data type .Net framework data type C# data type Attribute
BOOL System.Boolean bool
SINT System.SByte sbyte
INT System.Int16 short
DINT System.Int32 int
LINT System.Int64 long
USINT System.Byte byte
UINT System.UInt16 ushort
UDINT System.UInt32 uint
ULINT System.UInt64 ulong
REAL System.Single float
LREAL System.Double double
TIME System.Int32 int +
LTIME System.Int64 long +
LDATE System.Int64 long +
LTIME_OF_DAY System.Int64 long +
LDATE_AND_TIME System.Int64 long +
BYTE System.Byte byte +
WORD System.UInt16 ushort +
DWORD System.UInt32 uint +
LWORD System.UInt64 ulong +
STRING System.Iec61131Lib.IecStringEx
WSTRING (from 2021.6) System.Iec61131Lib.IecWString (from 2021.6)
ANY System.Iec61131Lib.Any +
ANY_MAGNITUDE System.Iec61131Lib.Any +
ANY_NUM System.Iec61131Lib.Any +
ANY_INT System.Iec61131Lib.Any +
ANY_SIGNED System.Iec61131Lib.Any +
ANY_UNSIGNED System.Iec61131Lib.Any +
ANY_REAL System.Iec61131Lib.Any +
ANY_BIT System.Iec61131Lib.Any +
ANY_ELEMENTARY System.Iec61131Lib.Any +
ANY_STRING System.Iec61131Lib.Any +

 

 

 


•  Web browser recommendation: Chrome/Edge 88 or newer, Firefox ESR 90 or neweror Safari • 
• Published/reviewed: 2023-06-16 • Revision 057 •