Elementary Data Types


Fernhill SCADA supports these elementary data types:

BOOLBoolean value0 or 1
SINTShort integer-128 to +127
USINTUnsigned short integer0 to 255
BYTESingle byte bitmask16#00 to 16#FF
INTInteger-32768 to +32767
UINTUnsigned integer0 to 65535
WORDTwo byte bitmask16#0000 to 16#FFFF
DINTDouble integer-2147483648 to +2147483647
UDINTUnsigned double integer0 to 4294967295
DWORDFour byte bitmask16#00000000 to 16#FFFFFFFF
LINTLong integer-9223372036854775808 to +9223372036854775807
ULINTUnsigned long integer0 to 18446744073709551615
LWORDEight byte bitmask16#0000000000000000 to 16#FFFFFFFFFFFFFFFF
REALSingle precision floating point-
LREALDouble precision floating point-
TIMEInterval value-
DATEDate value1601-01-01 to 9999-12-31
TIME_OF_DAY or TODTime of day00:00:00.000 to 23:59:59.999
DATE_AND_TIME or DTDate and time value1601-01-01-00:00:00.000 to 9999-12-31-23:59:59.999
CHARSingle byte character$00 to $FF
WCHARDouble byte character$0000 to $FFFF
STRINGSingle byte character string-
WSTRINGDouble byte character string-

Automatic Type Promotion

Elementary Types have a priority defined by the position in the above table. For example type REAL is higher priority than type INT.

When two different types are used in an operation automatic type promotion occurs. The inputs to the operation are all promoted to the same type as the highest priority input. For example if an INT is added to a REAL, the INT value is promoted to a REAL before the addition operation. The return value from this operation will be REAL.

Standards Compliance

Table 10 - IEC 61131-3 Second Edition.

Table 10 - IEC 61131-3 Third Edition.

Further Information

Numeric Literals

To learn about literals to represent numeric values.

Character String Literals

To learn about literals to represent characters and strings.

Date and Time of Day Literals

To learn about literals to represent dates and time of day.

Time Literals

To learn about literals to represent a time interval.

Common Elements

To learn about other language Common Elements.


For the meaning of terms used in Fernhill SCADA.