5-13
S7-200 Programmable Controller, CPU 210
C79000-G7076-C235-01
5.9 Logic Stack Instructions
And Load
The And Load instruction combines the values in the first and
second levels of the stack using a logical And operation. The
result is loaded in the top of stack. After the ALD executes, the
stack depth is one less.
Operands: none
Or Load
The Or Load instruction combines the values in the first and
second levels of the stack, using a logical Or operation. The
result is loaded in the top of stack. After the OLD executes, the
stack depth is one less.
Operands: none
Figure 5-10 illustrates the operation of the And Load and Or Load instructions.
S0
iv2
iv3
iv4
iv5
iv6
iv7
x
ALD: AND the top two stack values
iv0
iv1
iv2
iv3
iv4
iv5
iv6
iv7
Before After
S0 = iv0 * iv1
OLD: OR the top two stack values
S0 = iv0 + iv1
S0
iv2
iv3
iv4
iv5
iv6
iv7
x
iv0
iv1
iv2
iv3
iv4
iv5
iv6
iv7
Before After
Note: x means the value is unknown (it may be either a 0 or a 1).
Figure 5-10 And Load and Or Load Instructions
Logic Stack Example
LAD STL
NETWORK
LD I0.0
LD I0.1
LD I0.2
A I0.3
OLD
ALD
= Q0.0
I0.0
I0.1
I0.2
I0.3
Network 1
Q0.0
Figure 5-11 Example of Logic Stack Instructions
Instruction Set
S
T
L
ALD
S
T
L
OLD