Step 7 Elementary Data Types
Type and Size Format Options Range and Number Notation Example in STL
Description in (lowest to highest values)
Bits
BOOL (Bit) 1 Boolean text TRUE/FALSE TRUE
BYTE (Byte) 8 Hexadecimal B#16#0 to B#16#FF L B#16#10
number L byte#16#10
WORD (Word) 16 Binary number 2#0 to 2#1111_1111_1111_1111 L 2#0001_0000_0000_0000
Hexadecimal W#16#0 to W#16#FFFF L W#16#1000
number L word#16#1000
BCD C#0 to C#999 L C#998
Decimal number B#(0,0) to B#(255,255) L B#(10,20)
unsigned L byte#(10,20)
DWORD 32 Binary number 2#0 to 2#1111_1111_1111_1111_
L 2#1000_0001_0001_1000_
(Double word) 1111_1111_1111_1111
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 number B#(0,0,0,0) to L B#(1, 14, 100, 120)
unsigned B#(255,255,255,255) L byte#(1,14,100,120)
INT (Integer) 16 Decimal number -32768 to 32767 L 101
signed
DINT (Double 32 Decimal number L#-2147483648 to L#2147483647 L L#101
integer) signed
REAL (Floating- 32 IEEE Floating-point Upper limit +/-3.402823e+38 L 1.234567e+13
point number) number Lower limit +/-1.175495e-38
S5TIME 16 S7 time in steps of S5T#0H_0M_0S_10MS to L S5T#0H_1M_0S_0MS
(SIMATIC time) 10ms (default) S5T#2H_46M_30S_0MS and L
S5T#0H_0M_0S_0MS S5TIME#0H_1H_1M_0S_0MS
TIME (IEC time) 32 IEC time in steps of T#24D_20H_31M_23S_648MS L T#0D_1H_1M_0S_0MS
1 ms, integer signed to L TIME#0D_1H_1M_0S_0MS
T#24D_20H_31M_23S_647MS
DATE (IEC 16 IEC date in steps of D#1990-1-1 to L D#1996-3-15
date) 1 day D#2168-12-31 L DATE#1996-3-15
TIME 32 Time in steps of 1 TOD#0:0:0.0 to L TOD#1:10:3.3
_OF_DAY ms TOD#23:59:59.999 L TIME_OF_DAY#1:10:3.3
(Time)
CHAR 8 ASCII characters A', 'B' etc. L 'E'
(Character)
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
S5TIME Format
Time base Binary Code
10 ms 00
100 ms 01
1s 10
10 s 11
Symbol Table Allowed Addresses and Data
Types
English German Address
Description Data Type
Mnemonics Mnemonics Range
I/O Signals
I E Input bit BOOL 0 to 65535.7
IB EB Input byte BYTE, CHAR 0 to 65535
IW EW Input word WORD, INT, S5TIME, DATE 0 to 65534
ID ED Input double word DWORD, DINT, REAL, TOD, TIME 0 to 65532
Q A Output bit BOOL 0 to 65535.7
QB AB Output byte BYTE, CHAR 0 to 65535
QW AW Output word WORD, INT, S5TIME, DATE 0 to 65534
QD AD Output double word DWORD, DINT, REAL, TOD, TIME 0 to 65532
Marker Memory
M M Memory bit BOOL 0 to 65535.7
MB MB Memory byte BYTE, CHAR 0 to 65535
MW MW Memory word WORD, INT, S5TIME, DATE 0 to 65534
MD MD Memory double word DWORD, DINT, REAL, TOD, TIME 0 to 65532
Peripheral I/O
PIB PEB Peripheral input byte BYTE, CHAR 0 to 65535
PIW PEW Peripheral input word WORD, INT, S5TIME, DATE 0 to 65534
PID PED Peripheral input double word DWORD, DINT, REAL, TOD, TIME 0 to 65532
PQB PAB Peripheral output byte BYTE, CHAR 0 to 65535
PQW PAW Peripheral output word WORD, INT, S5TIME, DATE 0 to 65534
PQD PAD Peripheral output double word DWORD, DINT, REAL, TOD, TIME 0 to 65532
Timers and Counters
T T Timer TIMER 0 to 65535
C Z Counter COUNTER 0 to 65535
Logic Blocks
FB FB Function block FB 0 to 65535
OB OB Organization block OB 1 to 65535
FC FC Function FC 0 to 65535
SFB SFB System function block SFB 0 to 65535
SFC SFC System function SFC 0 to 65535
Data Blocks
DB DB Data block DB, FB, SFB, UDT 1 to 65535
User-defined data types
UDT UDT User-defined data type UDT 0 to 65535