The VarType column defines the object data type. The context menu shows which variable types can be assigned to an object. During project compilation, a check is made whether the variable type (UserVar) matches the object data type.
Note!
Not all objects support all data types.
The manual assignment of variables or data types not supported by the object may cause runtime errors.
The following basic data types are supported:
Basic types
Type
|
Bits
|
Min
|
Max
|
Text constant
|
Comment
|
BOOL
|
8
|
false = 0
|
true <> 0
|
• | Alphanumerical constants <> 0 = true |
|
|
BYTE
USINT
|
8
|
0
|
255
|
decimal
|
|
SINT
|
8
|
-128
|
127
|
decimal
|
|
WORD
UINT
|
16
|
0
|
65535
|
decimal
|
|
INT
|
16
|
-32768
|
32767
|
decimal
|
|
DWORD
UDINT
|
32
|
0
|
4294967295
|
decimal
|
|
DINT
|
32
|
-2147483648
|
2147483647
|
decimal
|
|
REAL
|
32
|
-3.402823466e+38
|
3.402823466e+38
|
Floating point number (decimal)
|
|
DT
|
32
|
0
DT#01d01m1970Y00H00M00S
|
4294967295
DT#07d02m2106Y06H28M15S
|
• | DT#<day>d<month>m<year>Y<hour>H<minutes>M<seconds>S |
Example:
DT#18d08m2011Y17H15M35S
=> 16 Aug. 2011 17:15:35
|
• | Resolution in seconds since 1.1.1970 |
• | Identical to DATE_AND_TIME |
|
DATE
|
32
|
0
DT#01d01m1970Y00H00M00S
|
4294944000
DT#07d07m2106Y
|
Example:
D#18d08m2011Y
=> 16 Aug. 2011
|
• | Resolution in seconds since 1.1.1970 |
|
TIME
|
32
|
0
T#0h0m0s0ms
|
4294967295
T#1193h2m47s295ms
|
decimal
T#<hour>h<minutes>m<seconds>s<milliseconds>ms
|
Resolution in milliseconds
Complies with IEC 61131-3
|
LWORD
|
64
|
0
|
18446744073709551615
|
decimal
|
|
LINT
|
64
|
-9223372036854775808
|
9223372036854775807
|
decimal
|
|
LREAL
|
64
|
-1.7976931348623158e+308
|
1.7976931348623158e+308
|
decimal with comma
|
|
These data types may possibly not correspond to the identically named data types of the data source. In this case, a conversion is carried out by means of the communication driver which may lead to a loss in accuracy.
Integer data types
The following data types are integer data types:
Numerical data types
The following data types are numerical data types:
Strings
Type
|
Bits of basic type
|
Comment
|
STRING
|
8
|
|
WSTRING
|
16
|
UTF16 LE
|
Strings have a default length of 80 characters. If a different length is required, this must be specified with a colon separator. STRING:30.
Arrays
Type
|
IEC
|
Comment
|
INT[<Dimension>]
|
ARRAY [0..<Dimension>] OF INT
|
|
WORD[<Dimension>]
|
ARRAY [0..<Dimension>] OF WORD
|
|
DWORD[<Dimension>]
|
ARRAY [0..<Dimension>] OF DWORD
|
|

Start index: 0
End index: <Dimension> -1
|