Type of Data
Description.
Size
in
Bits
BOOL (BIT )
BYTE
WORD
16
DWORD
32
Format
Boolean
Hexadecimal
Example
TRUE
L B#16#10
W#16#0 to W#16#FFFF
L W#16# 1000
DW#16#0000_0000 to
L DW#16# 10AB_FF00
DW#16#FFFF_FFFF
BYTE
WORD
16
DWORD
32
Binary
2# 0 to 2# 1111_1111
L 2#0000_1100
2# 0 to 2# 111_1111_1111_1111
L2#1111_1010_0000_1100
2# 0 to 2# 1111_1111_1111
L2#0011_1100_1111_1111
1111_1111_1111_1111_1111
WORD
16
DWORD
32
Unsigned
decimal
_1010_1100_0011_11111
B# (0,0 ) to B# ( 255,255 )
L B # ( 4 , 220 )
B# (0,0,0,0 ) to
L B# ( 255, 255,255,255 )
B#(255,255,255,255)
WORD
SIMATIC S7
16
BCD
C # 000 to C# 999
L C# 133
Number Formats
Type of Data
Description.
INT ( Integer )
DINT(Double
Size
in
Bits
16
32
Format
Signed Decimal
Signed Decimal
Integer )
REAL
S5 TIME
DATE
TIME-OF-DAY
CHAR.
SIMATIC S7
32
16
16
32
Example
IEEE
1.17549e -38 to
Floating Point
3.402823e+38
S5 Time - 10ms
S5t#0H_0M_0S_10MS to
to 9990s
S5t#2H_45M_30S_0MS
IEC date in 1-
D#1990-1-1 to
day units
D#2168 -12-31
Time of day in
TOD#0:0:0.0 to
1ms units
TOD#23:59:59.999
character
A , B and so on
L L#1
L 1. 234567e +13
L S5t#2H_45M_30S_0MS
L D#1999-3-15
L TOD# 1:10:3.3
LE
15
0
12 11
0
Sign
0=+ve
1=-ve
8 7
0
Decimal Values :
4 3
0
32
0
1
+ 8 + 4 = 44
31
24 23
16 15
8 7
SIMATIC S7
Decimal Value
Training for Automation
30
29
28
27 26
25
24
23
22
21
20 19
18
17
16
15
14
13
12
11 10
0 1 0 0 0 0 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2-23
2-1
S
Exponent: e = 8 Bit
Example:
S =0
e = 1000 0101 = 133
f = 1010 0000... = 0.5 + 0.125
SIMATIC S7