-

Elementary Data Types according to IEC 61131-3

Data type1Size in bitsRangeDefault initial value
BOOLBoolean1TRUE / FALSEFALSE
SINTShort integer8-128 to 1270
INTInteger16-32,768 to 32,7670
DINTDouble integer32-2,147,483,648 to 2,147,483,6470
LINTLong integer64-9,223,372,036,854,775,808 to 9,223,372,036,854,775,8070
USINTUnsigned short integer80 to 2550
UINTUnsigned integer160 to 65,5350
UDINTUnsigned double integer320 to 4,294,967,2950
ULINTUnsigned long integer640 to 18,446,744,073,709,551,6150
REALReal numbers32-3.402823466 E+38 (approx. 7 digits)
to
-1.175494351 E-38 (approx. 7 digits)

and

+1.175494351 E-38 (approx. 7 digits)
to
+3.402823466 E+38 (approx. 7 digits)

See the note below the table concerning REAL and LREAL processing.
0.0
LREALLong real numbers64~ -1.798 E+308 (approx. 15 digits)
to
~ -2.225 E-308 (approx. 15 digits)

and

~ +2.225 E-308 (approx. 15 digits)
to
~ +1.798 E+308 (approx. 15 digits)

See the note below the table concerning REAL and LREAL processing.
0.0
TIMEDuration32-24d20h31m23s648ms up to 24d20h31m23s647mst#0s
LTIMELong duration64- 106751d23h47m16s854ms775us808ns up to +106751d23h47m16s854ms775us807nsLTIME#0ns
BYTEBit string of length 880 to 255
(16#00...16#FF)
0
WORDBit string of length 16160 to 65,535
(16#00...16#FFFF)
0
DWORDBit string of length 32320 to 4,294,967,295
(16#00....16#FFFFFFFF)
0
LWORDBit string of length 64640 to 18,446,744,073,709,551,615
(16#00....16#FFFFFFFFFFFFFFFF)
0
LDATE / LDLong date64min. : 1677-09 -22

max. : 2262-04-11
LDATE#1970-01-01
LTIME_OF_DAY / LTODLong time of day64min. : 00:00:00.0

max. : 23:59:59.999999999

See the note below the table concerning LTOD processing.
LTOD#00:00:00
LDATE_AND_TIME / LDTLong date with time of day64min. : 1677-09-21-00:12:43.145224192

max. : 2262-04-11-23:47:16.854775807
LDT#1970-01-01-00:00:00

Note
If you are using PLCnext Engineer in another user interface language and/or with another Windows system locale than English you must enter numeric values with a '.' as decimal separator (always according to the English standard). This applies, for example, when entering initial values in variables tables or REAL/LREAL literals in the code.

Note
Processing of REAL and LREAL data types
There is a limited accuracy when processing REAL and LREAL data types. This is caused by the characteristics of the processor architecture and the data type definition according to IEEE. This applies to the positive and also the negative value range.

Note
Processing of LTOD data type
In the event of an overflow (min or max value for the LTOD data type exceeded), the LTOD value is interpreted and displayed as time value in nanoseconds ("xxxxx ns").

Data types STRING and WSTRING
The data types STRING (single byte string) and WSTRING (double byte string) are also elementary data types but do not belong to the above mentioned group. The data types STRING and WSTRING have the following structure:

ByteDescription
STRING data type
0...1Capacity - Maximum number of characters that the string can hold (from 0 to UINT16.MAX).
2...3Length - Current number of characters in the string (from 0 to Capacity).
4...84
(for an 80 characters string)

4...124
(for a user-defined string of 120 characters)
String of ANSI characters followed by a trailing zero character. Each character is represented by one byte.
WSTRING data type
0-1Capacity - Maximum number of characters that the string can hold (from 0 to UINT16.MAX).
2-3Length - Current number of characters in the string (from 0 to Capacity).
4...165
(for an 80 characters string)

4...245
(for a user-defined string of 120 characters)
String of UTF16 characters followed by a trailling zero character. Each character is represented by two bytes or, for some language characters, by four bytes.