Logic Stack Instructions; And Load; Or Load; Logic Stack Example - Siemens Simatic S7-200 CPU 210 System Manual

Table of Contents

Advertisement

5.9

Logic Stack Instructions

And Load

S
T
ALD
L

Or Load

S
T
OLD
L
Figure 5-10 illustrates the operation of the And Load and Or Load instructions.
ALD: AND the top two stack values
Before
iv0
iv1
iv2
iv3
iv4
iv5
iv6
iv7
Figure 5-10 And Load and Or Load Instructions

Logic Stack Example

Network 1
I0.0
I0.1
I0.2
Figure 5-11 Example of Logic Stack Instructions
S7-200 Programmable Controller, CPU 210
C79000-G7076-C235-01
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
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
After
S0
S0 = iv0 * iv1
iv2
iv3
iv4
iv5
iv6
iv7
x
Note: x means the value is unknown (it may be either a 0 or a 1).
LAD
Q0.0
I0.3
Instruction Set
OLD: OR the top two stack values
Before
After
iv0
S0
S0 = iv0 + iv1
iv1
iv2
iv2
iv3
iv3
iv4
iv4
iv5
iv5
iv6
iv6
iv7
iv7
x
STL
NETWORK
LD
I0.0
LD
I0.1
LD
I0.2
A
I0.3
OLD
ALD
=
Q0.0
5-13

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents