Siemens SIMATIC S5-115U User Manual page 258

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
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 com-
pared.
If input word IW 1 is greater
than or less than data word
DW 12, program scanning
jumps to the "Destination"
label.
1 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.
8-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
:JB= Desti-
nation
.
.
.
.
DEST.:A
I 12.2
.
.
S5-115U Manual
Explanation
Load input word IW 1 into
ACCUM 1. If the contents of
1
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 6130-02b
so that
H

Advertisement

Table of Contents
loading

Table of Contents