Академический Документы
Профессиональный Документы
Культура Документы
S5-100U
Programmable Controller
CPU 100/102/103
Reference Guide
Order No.
6ES5 997-8MA21
Index
Page
1
2
6
6
8
12
14
16
16
18
18
20
20
22
22
Supplementary Operations
Boolean Logic Operations
Bit Operations
Set/Reset Operations
Timer and Counter Operations
Load and Transfer Operations
Conversion Operations
Shift Operations
Jump Operations
Other Operations
24
24
26
28
30
32
32
32
34
System Operations
Set Operations
Load and Transfer Operations
Block Call Operations and Return Operations
Jump Operations
Arithmetic Operations
Other Operations
38
38
38
40
40
40
42
52
53
54
Evaluation of CC 1 and CC 0
56
50
Explanation of the
Operations List
Abbreviation
Explanation
ACCU 1
ACCU 2
Accumulator 2
CC0/CC1
CSF
OV
PII
PIQ
RLO
RLO
reloaded?
RLO
Y
dependent?
Y /
N
RLO
Y/N
affected?
STL
Explanation
of the Operands
Abb.
Explanation
BN
Byte constant
(fixed-point number)
Counter
- remanent
- not remanent
- for the bit test and
set operations
(system operat.)
CPU 102
CPU 103
- 127 to +127
0 to 7
8 to 15
0 to 15
0 to 7
8 to 127
0 to 127
DB
Data block
DL
Data word
(left byte)
0 to 255
DR
Data word
(right byte)
0 to 255
DW
Data word
0 to 255
Flag
- remanent
- not remanent
0 to 7
8 to 127
0 to 127
0.0 to
127.15
FB
*
Function block
0.0 to 255.15
2 to 255
2 to 63
0.0 to 63.7
64.0 to 127.7
0 to 63
0 to 63*
0 to 255
Abb.
Explanation
FB
FW
CPU 102
CPU 103
Flag byte
- remanent
- not remanent
0 to 62
64 to 126
0 to 255
64 to 254
Flag word
- remanent
- not remanent
0 to 62
64 to 126
0 to 255
64 to 254
Input
0.0 to 127.7
IB
Input byte
0 to 127
IW
Input word
0 to 126
KB
Constant (1 byte)
0 to 255
KC
Constant (count)
0 to 999
KF
Constant
(fixed-point number)
KH
Constant
(hexadecimal code)
0 to FFFF
KM
Constant
(2-byte bit pattern)
KS
Constant (2
characters)
KT
Constant (time)
KY
Constant (2 bytes)
- 32768 to +32767
any two
alphanumeric characters
0.0 to 999.3
0 to 255 (per byte)
Abb.
Explanation
CPU 102
CPU 103
OB
Organization block
for special applications:
1, 2, 13, 21, 22, 31,
34, 251
0 to 63
0 to 255
PB
Program block
(with block call and
return operations)
0 to 63
0 to 255
PB/
PY*
Peripheral byte
0 to 127
PW
Peripheral word
0 to 126
Output
QB
Output byte
0 to 127
QW
Output word
0 to 126
RS
SB
Timer
- for the bit test and
set operations
(system operat.)
0 to 255
0.0 to 255.15
Sequence block
0.0 to 127.7
0 to 255
0 to 15
0 to 31
0 to 31
0.0 to
127.15
Basic Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
typical
Execution Time
in s
7
4
75
typ.
75
typ.
80
typ.
CPU
102
70
CPU
100
typ.
(STL)
Function
CPU
103
MA02
CPU
103
MA03
1,6
0,8
1,6
0,8
1,6
0,8
1,6
0,8
T, C
I, Q, F
AN
T, C
I, Q, F
O
T, C
I, Q, F
ON
T, C
O
41
1,6
0,8
A(
61
1,6
0,8
O(
64
1,6
0,8
51
13
1,6
0,8
typ.
70
1,6
0,8
Set operand to 1.
Set/Reset Operations
S
I, Q, F
Basic Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
(STL)
1
typical
Execution Time
in s
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
I, Q, F
typ.
70
1,6
0,8
Reset operand to 0.
I, Q, F
typ.
70
1,6
0,8
Load Operations
L
IB
59
14
1,6
0,8
QB
63
14
1,6
0,8
IW
59
17
1,6
0,8
QW
63
17
1,6
0,8
PB/PY
(PG dep.)
--
--
--
--
91
68
PW
--
--
--
--
92
69
FB
64
14
1,6
0,8
Basic Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
(STL)
1
typical
Execution Time
in s
FW
71
17
1,6
0,8
DL
65
39
82
1,7
DR
65
41
83
1,7
DW
66
43
85
2,0
KB
54
59
1,45
KS
57
1,6
0,8
KF
57
1,6
0,8
KH
57
1,6
0,8
KM
57
1,6
0,8
KY
57
1,6
0,8
KT
57
1,6
0,8
Basic Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
(STL)
1
typical
Execution Time
in s
KC
57
1,6
0,8
T, C
typ.
70
19
1,6
0,8
LC
T, C
125
69
154
1,8
Transfer Operations
T
IB
51
1,6
0,8
QB
54
1,6
0,8
IW
53
11
1,6
0,8
QW
56
11
1,6
0,8
PB/PY
(PG dep.)
--
--
--
--
60
37
Basic Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
(STL)
1
typical
Execution Time
in s
PW
--
--
--
--
67
51
FY
55
1,6
0,8
FW
64
11
1,6
0,8
DL
53
31
75
1,15
DR
57
33
78
1,15
DW
59
36
81
1,4
Timer Operations
SP
125
74
147
1,9
SE
125
74
147
1,9
Basic Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
(STL)
1
typical
Execution Time
in s
127
76
150
1,9
SS
127
76
150
1,9
SF
125
74
144
1,9
126
75
96
1,9
Reset a timer.
Counter Operations
CU
79
42
105
1,9
Counter counts up 1.
CD
92
31
117
1,9
118
67
141
1,9
Set counter.
69
12
96
1,9
Reset counter.
Arithmetic Operations
+F
55
26
1,6
0,8
-F
58
23
1,6
0,8
Basic Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
(STL)
1
typical
Execution Time
in s
Comparison Operations
!=F
79
24
1,6
0,8
><F
82
27
1,6
0,8
>F
79
24
1,6
0,8
>=F
79
24
1,6
0,8
<F
82
27
1,6
0,8
<=F
82
27
1,6
0,8
PB
125
49
185
3,35
JU
FB
147
49
187
3,35
Basic Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
(STL)
1
typical
Execution Time
in s
SB
--
--
185
3,35
JC
PB
Y1)
130
53
190
3,35
JC
FB
Y1)
152
53
196
3,35
JC
SB
Y1)
--
--
194
3,35
DB
70
28
79
1,75
DB
--
--
233
182
BE
88
36
119
2,5
BEC
Y1)
90
38
121
2,5
BEU
88
36
119
2,5
35
1,6
0,8
Return Operations
No Operations
NOP 0
1) RLO is set to 1.
Basic Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
typical
Execution Time
in s
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
35
1,6
0,8
35
53
25
(STL)
1
No Operations (cont.)
NOP 1
Stop Operations
STP
35
1,6
0,8
BLD
131
35
1,6
0,8
BLD
132
35
1,6
0,8
BLD
133
35
1,6
0,8
BLD
255
35
1,6
0,8
Supplementary Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
(STL)
1
typical
Execution Time
in s
Formal operand
L, Q, F, T, C
--
--
202
151
AN=
Formal operand
L, Q, F, T, C
--
--
202
151
O=
Formal operand
L, Q, F, T, C
--
--
202
151
ON=
Formal operand
L, Q, F, T, C
--
--
202
151
AW
53
19
1,6
0,8
OW
53
19
1,6
0,8
XOW
51
19
1,6
0,8
--
--
187
123
Bit Operations
TB
T, C
Supplementary Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
(STL)
1
typical
Execution Time
in s
--
--
187
144
TB
RS
--
--
185
121
TBN
T, C
--
--
188
124
TBN
--
--
188
145
TBN
RS
--
--
186
122
SU
T, C
--
--
180
125
SU
--
--
183
146
RU
T, C
--
--
189
124
RU
--
--
189
146
Set/Reset Operations
S=
Formal operand
I, Q, F
--
--
202
151
RB=
Formal operand
I, Q, F
--
--
203
152
Supplementary Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
(STL)
1
typical
Execution Time
in s
Formal operand
T, C
--
--
197
147
==
Formal operand
I, Q, F
--
--
202
151
FR
T, C
--
--
98
1,9
FR=
Formal operand
T, C
--
--
194*
145*
SP=
Formal operand
T
--
--
194*
SD=
Formal operand
T
--
--
194*
SEC
=
Formal operand
T, C
--
--
194*
Supplementary Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
(STL)
1
typical
Execution Time
in s
CPU
100
Function
CPU
102
CPU
103
MA02
CPU
103
MA03
Formal operand
T, C
--
--
194*
SFD
=
Formal operand
T, C
--
--
194*
Formal operand
I, Q, F, T, C
--
--
142*
RS
--
--
77
LC=
Formal operand
T, C
--
--
194*
LW=
Formal operand
--
--
152
T=
Formal operand
I, Q, F
--
--
195*
61
76
Supplementary Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operands
1 RLO depend.
2 RLO affected
3 RLO reloaded
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
(STL)
1
typical
Execution Time
in s
Conversion Operations
CFW
42
1,6
0,8
CSW
60
23
1,6
0,8
47+
12+
n10
n10
0,8
47+
12+
n10
n10
1,6
0,8
Shift Operations
SLW
Parameter
n=0 ... 15
SRW
Parameter
n=0 ... 15
1,6
Jump Operations
JU
=
Symb. address
max. 4 charact.
62
1,6
0,8
JC
=
Symb. address
max. 4 charact.
Y1)
65
1,6
0,8
JZ
=
Symb. address
max. 4 charact.
69
1,6
0,8
1) RLO is set to 1.
Supplementary Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operanden
1 RLO depend.
2 RLO affected
3 RLO reloaded
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
(STL)
1
typical
Execution Time
in s
Symb. address
max. 4 charact.
69
10
1,6
0,8
JP
=
Symb. address
max. 4 charact.
71
1,6
0,8
JM
=
Symb. address
max. 4 charact.
71
1,6
0,8
JO
=
Symb. address
max. 4 charact.
65
1,6
0,8
IA
--
--
58
24
RA
--
--
58
26
Enable interrupt.
This operation cancels the effect of IA.
--
--
49
0,9
--
--
49
0,9
Other Operations
Supplementary Operations
For organization blocks (OB)
Oper-
Permissible
ation
Operanden
1 RLO depend.
2 RLO affected
3 RLO reloaded
Function
CPU
100
CPU
102
CPU
103
MA02
CPU
103
MA03
(AWL)
1
typical
Execution Time
in s
Formal
operand
--
--
252*
DO
DW **
--
--
229
171
DO
FW **
--
--
179
138
L, LC, T;
JU, JC, JZ, JN, JP, JM, JO, SLW, SRW;
D, I;
C DB, T RS, TNB
System Operations
(for CPU 102 and higher)
For organization blocks (OB)
Oper-
Permissible
ation
Operanden
1 RLO depend
2 RLO affected
3 RLO reloaded
typical
Execution Time
in s
CPU
100
(STL)
Function
CPU
102
CPU
103
MA02
CPU
103
MA03
Set Operations
SU
RS
--
--
167
123
RU
RS
--
--
167
123
0 ( ACCU 1)
2 ( ACCU 2)
--
--
105
76
TIR
0 ( ACCU 1)
2 ( ACCU 2)
--
--
85
61
TNB
Parameter
n=0 ... 255
13+
--
n19
97+
75+
(48+
n21
n16
71
59
n19)
RS
--
--
OB
--
--
187
3,35
JC
OB
Y1)
--
--
194
3,35
1) RLO is set to 1
System Operations
(for CPU 102 and Higher)
For organization blocks (OB)
Oper-
Permissible
ation
Operanden
1 RLO depend.
2 RLO affected
3 RLO reloaded
typical
Execution Time
in s
Function
CPU
100
--
--
131
82
(STL)
CPU
102
CPU
103
MA02
CPU
103
MA03
Jump Operation
JUR
Arithmetic Operations
ADD
BF
--
--
58
35
ADD
KF
--
--
104
68
STS
--
--
TAK
--
--
Other Operations
Stop operation. Program processing is interrupted
immediately after this operation.
74
57
Machine Code
Listing
Explanation of the Indices
a
+ byte address
b
+ bit address
c
+ parameter address
d
+ timer number
e
+ constant
f
+ block number
g
+ word address
h
+ number of shifts
i
+ relative jump address
k
+ register address
l
+ block length in bytes
m
+ jump displacement (16 bits)
n
+ value
o
+ counter number
Machine Code
B0
B1
B2
L
Operation
B3
R
Operand
NOP 0
CFW
0d
0d
0l
0l
TNB
0d
0d
FR
BEC
0c
0c
FR=
0c
0c
A=
IA
RA
CSW
0a
0a
FY
0a
0a
FY
0d
0d
LC
0i
0i
JO=
Machine Code
B0
B1
B2
L
Operation
B3
R
Operand
0c
0c
LC=
0c
0c
O=
BLD
130
BLD
131
BLD
132
BLD
133
BLD
255
0n
0n
0a
0a
FW
0a
0a
FW
0d
0d
SF
0i
0i
JP=
0c
0c
SFD=
0c
0c
S=
0n
0n
0d
0d
SE
0f
0f
JC
FB
0c
0c
SEC=
0c
0c
==
0f
0f
>F
<F
><F
!=F
>=F
DB
Machine Code
B0
B1
L
B2
R
Operation
B3
R
Operand
<=F
0g
0g
DL
0g
0g
DL
0d
0d
SD
0i
0i
JM=
0c
0c
SD=
0c
0c
AN=
0e
0e
KB
0g
0g
DR
0g
0g
DR
0d
0d
SS
0i
0i
JU=
0c
0c
SSU=
0c
0c
ON=
0e
0e
0e
0e
KC
0e
0e
0e
0e
KT
0e
0e
0e
0e
KF
0e
0e
0e
0e
KS
0e
0e
0e
0e
KY
0e
0e
0e
0e
KH
0e
0e
0e
0e
KM
0g
0g
DW
0g
0g
DW
0d
0d
SP
0i
0i
JN=
0c
0c
SP=
Machine Code
B0
L
B1
R
B2
R
Operation
B3
R
Operand
0c
0c
RB=
0d
0d
0f
0f
JU
FY
0c
0c
RD=
0c
0c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ical Index
of Operations
Operation
Page
Operation
Page
6, 47, 48
FR
28, 42, 45
A(
6, 48
FR=
28, 42
A=
24, 42, 44
20, 47
ADD
40, 45, 46
34, 43
AN
6, 47-49
IA
34, 42
AN=
24, 44
JC
AW
24, 45
JC=
32, 48
BE
20, 46
JM=
34, 44
BEC
20, 42
JN=
34, 44
BEU
20, 46
JO=
34, 42
BLD 130
22, 43
JP=
34, 43
BLD 131
22, 43
JU
BLD 132
22, 43
JUR
40, 46
BLD 133
22, 43
JU=
32, 44
BLD 255
22, 43
JZ=
32, 45
20, 43
CD
16, 46
L=
30, 45
CFW
32, 42
LC
12, 42, 45
CSW
32, 42
LC=
30, 43
CU
16, 46
LIR
38, 45
34, 43
LW=
30, 45
DO
36, 45, 46
NOP 0
20, 42
DO=
36, 47
NOP 1
22, 49
Operation
Page
Operation
Page
6, 43, 47, 48
SS
16, 44
O(
6, 48
SSU=
30, 44
24, 43
STP
22, 46
ON
6, 47-49
STS
40, 46
ON=
24, 44
SU
OW
24, 45
8, 16, 45-48
T=
30, 46
RA
34, 42
TAK
40, 46
RB=
26, 45
TB
RD=
28, 45
TBN
26, 46, 47
RU
TIR
38, 45
6, 16, 46-48
TNB
38, 42
S=
26, 43
XOW
24, 45
SD
16, 44
6, 48
SD=
28, 44
SE
14, 43
==
28, 43
SEC=
28, 43
+F
16, 47
SF
16, 43
-F
16, 46
SFD=
30, 43
!=F
18, 43
SP=
28, 44
>F
18, 43
SLW
32, 46
>=F
18, 43
SP
14, 44
><F
18, 43
JUR
40, 46
<F
18, 43
SRW
32, 46
<=F
18, 44
O=
8, 47, 48
Integral Blocks
Intregral Organisation Blocks
OB-No.
Function
OB integrated in
CPU
100
Interrupt-driven program
processing
OB13
OB22
Battery failure
OB251
102
103
Function
FB integrated in
CPU
100
FB240
FB241
FB242
FB243
FB250
FB251
FB is ready
102
103
Argument
Block ID:
SL1:
SLN
SF
EF
KBE
KBS
PGN
SINEC L1
p
DBx DWy
DBxDWy
MBy
MBy
p
p=1 ... 30
Meaning
Slave number
Location of Send Mailbox
Location of Receive Mailbox
Location of Coordination Byte Receive
Location of Coordination Byte Send
Programmer bus number
y=0 ... 255
SDP:
WD
System-Dependent-Parameter
D
TFB:
OB13
Timer-Funktions-Baustein
p
CLP:
Clock-Parameters
STP
SAV
p
DBxDWy,MWz,EWv
or AWv
DBxDWy,MWz,EWv
or AWv
J/Y/N
J/Y/N
OHE
J/Y/N
SET
wd dd.mm.yy
hh:mn:ss1 AM/PM2
wd dd.mm.
hh:mn:ss1 AM/PM2
hhhhhh:mn:ss1
STW
TIS
OHS
Evaluation
of CC 1 and CC 0
CC
1
CC
0
Arithmetic
Operations
Digital
Logic
Operations
Result
Result
=0
=0
Result
<0
Result
>0
Result
0
Comparison
Operations
Shift
Operations
ACCU 2
=
ACCU 1
shifted
bit =0
ACCU 2
<
ACCU 1
ACCU 2
shifted
>
ACCU 1
bit =1
Conversion
Operations
Result
<0
Result
>0
Siemens AG
AUT E1114B
Postfach 1963
Werner-von-SiemensStr. 50
D-92209 Amberg
Fed. Rep. of Germany
From
Name
Company/Department
Address
Telephone
Publication:
Programmable Controller
SIMATIC S5-100U (CPU 100/102/103)
Reference Guide
Order No.: 6ES5 997-8MA21
Suggestions / Corrections:
Siemens AG
Automation Group
Industrial Automation Systems
Postfach 4848, 8500 Nrnberg 1
Siemens AG 1992
Subject to change without prior notice
Siemens Aktiengesellschaft
Order No. 6ES5 997-8MA21
Printed in the Fed. Rep. of Germany