Step 7 Elementary Data Types
Step 7 Elementary Data Types
1 of 3
http://www.plcdev.com/book/export/html/382
Size Format
Description
in
Notation
Options
Bits
Example in STL
(lowest to highest
values)
BOOL (Bit)
1 Boolean text
TRUE/FALSE
TRUE
BYTE (Byte)
8 Hexadecimal
B#16#0 to B#16#FF
L B#16#10
number
WORD (Word)
16 Binary
L byte#16#10
2#0 to
number
2#1111_1111_1111_1111
Hexadecimal
W#16#0 to W#16#FFFF
number
L 2#0001_0000_0000_0000
L W#16#1000
L word#16#1000
BCD
C#0 to C#999
L C#998
Decimal
B#(0,0) to B#(255,255)
L B#(10,20)
L byte#(10,20)
number
unsigned
DWORD
(Double word)
32 Binary
number
2#0 to
2#1111_1111_1111_1111_
1111_1111_1111_1111
L
2#1000_0001_0001_1000_
1011_1011_0111_1111
Hexadecimal
W#16#0000_0000 to
L DW#16#00A2_1234
number
W#16#FFFF_FFFF
L dword#16#00A2_1234
Decimal
B#(0,0,0,0) to
number
B#(255,255,255,255)
L byte#(1,14,100,120)
-32768 to 32767
L 101
unsigned
INT (Integer)
16 Decimal
number
25-Sep-13 11:43 PM
2 of 3
http://www.plcdev.com/book/export/html/382
signed
DINT (Double
integer)
32 Decimal
number
L#-2147483648 to
L L#101
L#2147483647
signed
REAL
32 IEEE
Upper limit
(Floating-point
Floating-point +/-3.402823e+38
number)
number
L 1.234567e+13
Lower limit
+/-1.175495e-38
S5TIME
16 S7 time in
S5T#0H_0M_0S_10MS to
L S5T#0H_1M_0S_0MS
(SIMATIC
steps of
S5T#2H_46M_30S_0MS and
time)
10ms
S5T#0H_0M_0S_0MS
S5TIME#0H_1H_1M_0S_0MS
(default)
TIME (IEC
time)
32 IEC time in
T#24D_20H_31M_23S_648MS L T#0D_1H_1M_0S_0MS
steps of 1
to
ms, integer
T#24D_20H_31M_23S_647MS
L TIME#0D_1H_1M_0S_0MS
signed
DATE (IEC
date)
16 IEC date in
steps of 1
D#1990-1-1 to
L D#1996-3-15
D#2168-12-31
L DATE#1996-3-15
day
TIME _OF_DAY
(Time)
CHAR
(Character)
L TOD#1:10:3.3
TOD#23:59:59.999
L TIME_OF_DAY#1:10:3.3
L 'E'
characters
S5TIME NOTES
Underscores in time and date are optional
It is not required to specify all time units (for example: T#5h10s is valid)
Maximum time value = 9,990 seconds or 2H_46M_30S
25-Sep-13 11:43 PM
3 of 3
http://www.plcdev.com/book/export/html/382
S5TIME Format
00
100 ms
01
1s
10
10 s
11
25-Sep-13 11:43 PM