Siemens Simatic S5-101U Programming Instructions Manual page 36

Table of Contents

Advertisement

Example
I f none o f the i n p u t s o f
i n p u t word I W
1
i s set,
a jump i s made t o l a b e l
"AN 1"
I f the i n p u t word I W 1
and output word 'QW 0 are
n o t i d e n t i c a l , a jump i s
made back t o l a b e l "AN 0".
If I W 1 and QW 3 are iden-
t i c a l , I W 1 i s compared
w i t h data word DW 12.
I f I W 1 i s greater o r
smaller than D W 12, a
jump i s made t o the
"Destination" label.
STL
AN0 : I W
JZ.ANII
: A
I W
AN]. :L
I W 1
:L
QW
:XW
: JP=ANO
m
:L
I W 1
:L
DW12
:
F
:JB=Destina-
t i o n
0
Desti-:A 112.2
n a t i o n
.
Explanation
I n p u t word I W 1 i s loaded i n t o
accumulator 1. If the contents
o f accumulator 1 a r e equal t o
zero, a jump i s executed t o l a b e l
"AN l",
otherwise t h e n e x t s t a t e -
rnent ( A I 1.0) i s executed.
Comparison o f i n p u t word I W 1
and output word QW3. If the two
words are n o t i d e n t i c a l , i n d i v i d u a l
b i t s are s e t i n accumulator 1.
I f the contents o f accumulator 1
are n o t zero, a jump i s made back
t o the "AN 0" l a b e l , otherwise the
next statements are executed.
I n p u t word I W 1 i s compared w i t h
data word W 12 f o r g r e a t e r o r l e s s
than. If I W 1 i s g r e a t e r o r l e s s
than D W 12, t h e RLO i s s e t t o
"1".
If RLO
=
"l",
a jump i s made t o the
"Destination" l a b e l .
If RLO
=
"O",
t h e n e x t statement i s
executed.

Advertisement

Table of Contents
loading

Table of Contents