S5-100U
STEP 5 Operations
Figure 8-6 shows how the contents of a data word determine the parameter of the next statement.
Figure 8-6.
Executing a “DO” Operation
DW 12
DW 13
KH = 0108
KH = 0001
:C
DB
6
.
.
.
:DO DW
12
:A
I
0.0
:DO DW
13
:FR T
0
:C
DB
6
.
.
.
.
:A
I
8.1
.
:FR T
1
Actual program
DB6
FBx
The following example illustrates how new parameters are generated in every program scan.
STL
Explanation
Example
Set the contents of data words
DW20 to DW100 to signal state
“0”. The index register for the
parameter for the data words is
DW1.
:C
DB 202
:L
KB 20
:T
DW 1
F 1
:L
KH 0
:DO
DW 1
:T
DW 0
:L
DW 1
:L
KB 1
:+F
:T
DW 1
:L
KB 100
:<=F
:JC = F 1
Call data block DB202.
Load constant number 20 in
ACCU 1.
Transfer contents from ACCU 1 to
data word DW1.
Load hex constant 0 in ACCU 1.
DO data word DW1.
Transfer the contents from ACCU 1
to the data word whose address is
stored in data word DW1.
Load data word DW1 in ACCU 1.
Load constant number 1 in ACCU 1.
Data word DW1 is shifted to
ACCU 2.
ACCU 2 und ACCU 1 are added,
and the result is stored in ACCU 1
(data word address is higher).
Transfer contents of ACCU 1 to data
word DW1 (new data word address).
The constant number 100 is loaded
in ACCU 1 and the new data word
address is shifted to ACCU 2.
Compare the ACCUs for less than or
equal to: ACCU 2 ACCU 1.
Jump conditionally to label F1, if
ACCU 2 ACCU 1.
EWA 4NEB 812 6120-02b
8-55
Summary of Contents for SIMATIC S5-100U
Page 6: ...EWA 4NEB 812 6120 02b ...
Page 16: ...EWA 4NEB 812 6120 02b ...
Page 21: ...1 The SIMATIC S5 System Family EWA 4NEB 812 6120 02b ...
Page 22: ...Figures 1 1 Members of the SIMATIC S5 System Family 1 1 EWA 4NEB 812 6120 02b ...
Page 23: ......
Page 27: ......
Page 36: ...EWA 4NEB 812 6120 02b ...
Page 40: ......
Page 41: ......
Page 42: ......
Page 43: ......
Page 48: ......
Page 49: ......
Page 50: ......
Page 102: ...EWA 4NEB 812 6120 02b ...
Page 156: ...EWA 4NEB 812 6120 02b ...
Page 232: ...EWA 4NEB 812 6120 02b ...
Page 268: ...EWA 4NEB 812 6120 02b ...
Page 272: ...EWA 4NEB 812 6120 02b ...
Page 336: ...EWA 4NEB 812 6120 02b ...
Page 352: ...EWA 4NEB 812 6120 02b ...
Page 412: ...EWA 4NEB 812 6120 02b ...
Page 482: ...EWA 4NEB 812 6120 02b ...
Page 484: ...EWA 4NEB 812 6120 02b ...
Page 505: ...B Dimension Drawings EWA 4NEB 812 6120 02b ...
Page 515: ...C Active and Passive Faults in Automation Equipment EWA 4NEB 812 6120 02b ...
Page 516: ...EWA 4NEB 812 6120 02b ...
Page 522: ...EWA 4NEB 812 6120 02b ...
Page 523: ...D Information for Ordering Accessories EWA 4NEB 812 6120 02b ...
Page 524: ...EWA 4NEB 812 6120 02b ...
Page 530: ...EWA 4NEB 812 6120 02b ...
Page 531: ...E Reference Materials EWA 4NEB 812 6120 02b ...
Page 532: ...EWA 4NEB 812 6120 02b ...
Page 534: ...EWA 4NEB 812 6120 02b ...
Page 535: ...F Siemens Addresses Worldwide EWA 4NEB 812 6120 02b ...
Page 536: ...EWA 4NEB 812 6120 02b ...
Page 542: ...EWA 4NEB 812 6120 02b ...
Page 543: ...Index EWA 4NEB 812 6120 02b ...
Page 544: ...EWA 4NEB 812 6120 02b ...
Page 550: ...EWA 4NEB 812 6120 02b ...