Logic Stack Instructions - Siemens SIMATIC S7-200 System Manual

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

Logic Stack Instructions

AND Load
The AND Load instruction (ALD) 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 is executed, the stack depth is decreased by one.
OR Load
The OR Load instruction (OLD) 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 the stack. After
the OLD is executed, the stack depth is decreased by one.
Logic Push
The Logic Push instruction (LPS) duplicates the top value on the stack and pushes this value onto
the stack. The bottom of the stack is pushed off and lost.
Logic Read
The Logic Read instruction (LRD) copies the second stack value to the top of stack. The stack is
not pushed or popped, but the old top-of-stack value is destroyed by the copy.
Logic Pop
The Logic Pop instruction (LPP) pops one value off of the stack. The second stack value becomes
the new top of stack value.
AND ENO
The AND ENO instruction (AENO) performs a logical AND of the ENO bit with the top of the stack
to generate the same effect as the ENO bit of a box in LAD or FBD. The result of the AND
operation is the new top of stack.
ENO is a Boolean output for boxes in LAD and FBD. If a box has power flow at the EN input and
is executed without error, the ENO output passes power flow to the next element. You can use the
ENO as an enable bit that indicates the successful completion of an instruction. The ENO bit is
used with the top of stack to affect power flow for execution of subsequent instructions. STL
instructions do not have an EN input. The top of the stack must be a logic 1 for conditional
instructions to be executed. In STL there is also no ENO output. However, the STL instructions
that correspond to LAD and FBD instructions with ENO outputs set a special ENO bit. This bit is
accessible with the AENO instruction.
Load Stack
The Load Stack instruction (LDS) duplicates the stack bit (N) on the stack and places this value
on top of the stack. The bottom of the stack is pushed off and lost.
Table 6-5
Valid Operands for the Load Stack Instruction
Inputs/Outputs
N
Data Type
Operands
BYTE
Constant (0 to 8)
S7-200 Instruction Set
Chapter 6
75

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents