Siemens SIMATIC S5-90U System Manual page 223

Table of Contents

Advertisement

S5-90U/S5-95U
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 6115-02b
FBx
:C
DB
.
.
.
:B
DW
:A
F
:B
DW
:SS T
Figure 8-6. Executing a DO Operation
STL
:C
DB 202
:L
KB 20
:T
DW 1
F 1
:L
KH 0
:B
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
F
0.0
.
13
:SS T
0
Explanation
Call data block DB 202.
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:
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

This manual is also suitable for:

Simatic s5-95u

Table of Contents