5 Data types and fields
Double integer (4 bytes)
Keyword: UDINT
Value range: 0 to 4294967295 (0 to 2
Declaration of a variable (example):
VAR
udExample : UDINT;
END_VAR
Declaration of a constant (example):
VAR CONSTANT
udConstExample : UDINT := 100000;
END_VAR
Assignment (example):
udExample := 200000;
Floating-point number
Keyword: REAL
Value range: -1.5E-45 to 1.0E37
(Values ≥ 1.0E37 are interpreted as error values.)
Declaration of a variable (example):
VAR
rExample : REAL;
END_VAR
Declaration of a constant (example):
VAR CONSTANT
rConstExample : REAL := 0.0;
END_VAR
Assignment (example):
rExample := 1.0;
Date and time
Keywords: DT or DATE_AND_TIME
Value range: yyyy-mm-dd-hh:mm:ss
Declaration of a variable (example):
VAR
dtExample : DT;
END_VAR
Declaration of a constant (example):
VAR CONSTANT
dtConstExample : DT := dt#2017-12-31-23:59:59;
END_VAR
Assignment (example):
dtExample := dt#2017-01-01-08:00:00;
26
32
-1)