5
Data types and fields
5.1
Data types
The ST module supports the following data types:
•
Boolean value (BOOL)
•
Integer without prefix sign, 2 bytes (UINT)
•
Double integer without prefix sign, 4 bytes (UDINT)
•
Floating-point number (REAL)
•
Date and time (DT or DATE_AND_TIME)
NOTE!
No range monitoring of the data types takes place during operations.
Exceptions: square root function (SRQT), reciprocal (1/x)
Boolean value
Keyword: BOOL
Value range: TRUE or FALSE
Declaration of a variable (example):
VAR
bExample : BOOL;
END_VAR
Declaration of a constant (example):
VAR CONSTANT
bConstExample : BOOL := FALSE;
END_VAR
Assignment (example):
bExample := TRUE;
Integer (2 bytes)
Keyword: UINT
Value range: 0 to 65535 (0 to 2
Declaration of a variable (example):
VAR
uiExample : UINT;
END_VAR
Declaration of a constant (example):
VAR CONSTANT
uiConstExample : UINT := 0;
END_VAR
Assignment (example):
uiExample := 1;
16
-1)
5 Data types and fields
25