Siemens SIMATIC S5-95F Manual page 236

Table of Contents

Advertisement

STEP 5 Operations
Processing Jump Operations
A symbolic jump destination (jump label) must always be entered next to a jump operation. This
jump label can have up to four characters. The first character must be a letter of the alphabet.
When programming, please be aware of the following items:
The absolute jump displacement cannot exceed +127 or - 128 words in the program memory.
Some statements take up two words (e.g., "Load a constant"). For long jumps, insert an inter-
mediate destination.
Jumps can be executed only within a block.
Jumping over segment boundaries ("BLD 255") is not permitted.
Jump labels can be set only if the preceding operation has reloaded the RLO. Jump labels to a
sequence of binary scans (RLO sequence) are recognized by the operating system and are
rejected with an error message.
Example
If no bit of input word IW1 is
set, program scanning jumps to
the label "AN 1". If input word
IW1 and output word QW3 do
not agree, program processing
jumps back to the label "AN 0".
Otherwise input word IW1 and
data word DW12 are compared.
If input word IW1 is greater than
or less than data word DW12,
program scanning jumps to the
"DEST" label.
The "L..." statement does not affect the condition codes. An addition (+F) is executed with the constant
1
0000
so that the "JZ" operation can evaluate the contents of the accumulator.
H
8-56
STL
AN0
:L
IW 1
:L
KH 0000
:+F
:JZ=
AN 1
:A
I 0.0
.
.
.
.
.
:=
Q4.0
AN1
:L
IW 1
:L
QW 3
:XOW
:JN = AN 0
:L
IW 1
:L
DW12
:><
F
:JC = DEST
.
.
.
.
.
DEST
:A
I 0.1
.
.
Explanation
Load input word IW1 into
ACCU 1. If the contents of
1
ACCU 1 equal zero
, jump to
the label "AN 1". Otherwise
process the next statement
(I 0.0).
End of an RLO sequence
Compare input word IW1 and
output word QW3. If they are
not equal, set individual bits in
ACCU 1.
If the contents of ACCU 1 are
not zero, jump to the label
"AN 0". Otherwise process the
next statements.
Compare input word IW1 and
data word DW12. If they are
not equal, set RLO to "1".
If the RLO = "1", jump to the
"DEST" label. If the RLO =
"0", process the next
statement.
EWA 4NEB 812 6210-02
S5-95F

Advertisement

Table of Contents
loading

Table of Contents