Siemens SIMATIC S5-100U System Manual page 213

Simatic s5 series cpu 100/102/103
Hide thumbs Also See for SIMATIC S5-100U:
Table of Contents

Advertisement

S5-100U
Figure 8-6 shows how the contents of a data word determine the parameter of the next statement.
DB6
DW 12
KH = 0108
DW 13
KH = 0001
The following example illustrates how new parameters are generated in every program scan.
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.
EWA 4NEB 812 6120-02b
FBx
:C
DB
.
.
.
:DO DW
:A
I
:DO DW
:FR T
Figure 8-6. Executing a "DO" Operation
STL
: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
STEP 5 Operations
Actual program
6
:C
DB
.
.
.
.
12
:A
I
0.0
.
13
:FR T
0
Explanation
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.
6
8.1
1
8-55

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents