Siemens SIMATIC S5 Manual page 154

Hide thumbs Also See for SIMATIC S5:
Table of Contents

Advertisement

STEP 5 Operations
Example
If no bit of input word IW 1 is set,
program scanning jumps to the
label "AN 1". If input word IW 1
and output word QW 3 do not
agree, program processing jumps
back to the label "AN 0".
Otherwise input word IW 1 and
data word DW 12 are compared.
If input word IW 1 is greater than
or less than data word DW 12,
program scanning jumps to the
"Destination" label.
*
The "L..." statement does not affect the condition codes. An addition (+F) is executed with the constant 0000
the "JZ" operation can evaluate the contents of the accumulator.
3-58
STL
AN0
:L
IW 1
:L
KH 0000
:+F
:JZ= AN 1
:A
I 1.0
.
.
.
.
.
.
AN1
:L
IW 1
:L
QW3
:XOW
:JN = AN 0
:L
IW 1
:L
DW12
:><
F
:JC = Desti-
nation
.
.
.
.
.
DEST :A
I 12.2
.
.
S5-115F Manual
Explanation
Load input word IW 1 into
ACCUM 1. If the contents of
ACCUM 1 equal zero
, jump to
*
the label "AN 1". Otherwise
process the next statement
(A I 1.0).
Compare input word IW 1 and
output word QW 3. If they are
not equal, set individual bits in
ACCUM 1.
If the contents of ACCUM 1 are
not zero, jump to the label
"AN 0". Otherwise process the
next statements.
Compare input word IW 1 and
data word DW 12. If they are
not equal, set RLO to "1".
If the RLO = "1", jump to the
"Destination" label.
If the RLO = "0", process the
next statement.
EWA 4NEB 811 6149-02
so that
H

Advertisement

Table of Contents
loading

This manual is also suitable for:

S5-115f

Table of Contents