Siemens SIMATIC S7-200 System Manual page 85

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

Advertisement

Positive and Negative Transition Instructions
The Positive Transition contact instruction (EU) allows power to flow for one scan for each
off-to-on transition. The Negative Transition contact instruction (ED) allows power to flow for one
scan for each on-to-off transition. For the Positive Transition instruction, detection of a 0-to-1
transition in the value on the top of the stack sets the top of the stack value to 1; otherwise, it is set
to 0. For a Negative Transition instruction, detection of a 1-to-0 transition in the value on the top of
the stack sets the top of the stack value to 1; otherwise, it is set to 0.
For run mode editing (when you edit your program in RUN mode), you must enter a parameter for
the Positive Transition and Negative Transition instructions. Refer to Chapter 5 for more
information about editing in RUN mode.
Table 6-3
Valid Operands for the Bit Logic Input Instructions
Inputs/Outputs
Bit
Bit (immediate)
As shown in Figure 6-2, the S7-200 uses a logic stack to resolve the control logic. In these
examples, "iv0" to "iv7" identify the initial values of the logic stack, "nv" identifies a new value
provided by the instruction, and "S0" identifies the calculated value that is stored in the logic stack.
Load (LD, LDI,
Before
LDN, LDNI)
iv0
Loads a new
iv1
value (nv) onto
the stack.
iv2
iv3
iv4
iv5
iv6
iv7
2
iv8
1
S0 identifies the calculated value that is stored in the logic stack.
2
After the execution of a Load, the value iv8 is lost.
Figure 6-2
Operations of the Contact Instructions.
Tip
Because the Positive Transition and Negative Transition instructions require an on-to-off or an
off-to-on transition, you cannot detect an edge-up or edge-down transition on the first scan.
During the first scan, the S7-200 sets the state of the bit specified by these instructions. On
subsequent scans, these instructions can then detect transitions for the specified bit.
Data Type
Operands
BOOL
I, Q, V, M, SM, S, T, C, L, Power Flow
BOOL
I
And (A, AI, AN,
After
Before
ANI)
nv
iv0
ANDs a new
iv0
iv1
value (nv) with
the initial value
iv1
iv2
(iv) at the top of
iv2
iv3
the stack.
iv3
S0=iv0 AND nv
iv4
iv4
iv5
iv5
iv6
iv6
iv7
iv7
iv8
S7-200 Instruction Set
Or (O, OI, ON,
After
Before
ONI)
1
S0
iv0
ORs a new
iv1
iv1
value (nv) with
the initial value
iv2
iv2
(iv) at the top of
iv3
iv3
the stack.
iv4
S0=iv0 OR nv
iv4
iv5
iv5
iv6
iv6
iv7
iv7
iv8
iv8
Chapter 6
After
1
S0
iv1
iv2
iv3
iv4
iv5
iv6
iv7
iv8
71

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents