Siemens SIMATIC S5-115U User Manual page 256

Simatic s5 series cpu 941-7ub11 cpu 942-7ub11 cpu 943-7ub11 and cpu 943-7ub21 cpu 944-7ub11 and cpu 944-7ub21
Table of Contents

Advertisement

STEP 5 Operations
The following example shows how new parameters are generated each time the program is
scanned.
Example
Set the contents of data words
DW 20 to DW 100 to signal
state "0". The "index register"
for the parameter of the data
words is DW 1.
8-56
STL
:C
DB 202
Call data block 202.
:L
KB 20
Load constant 20 into ACCUM 1.
:T
DW 1
Transfer contents of ACCUM 1 to
DW 1.
L 1 :L
KH 0
Load hexadecimal constant 0 into
ACCUM 1.
:DO
DW 1
Process data word 1.
:T
DW 0
Transfer the contents of ACCUM 1
to the data word whose address is
stored in data word DW 1.
:L
DW 1
Load data word DW 1 into
ACCUM 1.
:L
KB 1
Load constant 1 into ACCUM 1.
Data word DW 1 is shifted to
ACCUM 2.
:+F
ACCUM 2 and ACCUM 1 are added
and the result is stored in ACCUM 1
(incrementing the data word
address).
:T
DW 1
Transfer the contents of ACCUM 1
to data word DW 1 (new data
word address).
:L
KB 100
The constant 100 is loaded into
ACCUM 1 and the new data word
address is shifted to ACCUM 2.
:<=F
The accumulators are compared to
see if ACCUM 2 ACCUM 1.
:JC = L 1
Jump conditionally to label L1 if
ACCUM 2 ACCUM 1.
S5-115U Manual
Explanation
EWA 4NEB 811 6130-02b

Advertisement

Table of Contents
loading

Table of Contents