Professional Documents
Culture Documents
Sequence Control Relay
Sequence Control Relay
SCR instructions provide you with a simple yet powerful state control
programming technique that fits naturally into a LAD, FBD, or STL program.
Whenever your application consists of a sequence of operations that must be
performed repetitively, SCRs can be used to structure your program so that it
corresponds directly to your application. As a result, you can program and
debug your application more quickly and easily.
The Load Sequence Control Relay (LSCR) instruction loads the SCR and
logic stacks with the value of the S bit referenced by the instruction (N).
The SCR segment is energized or de-energized by the resulting value of the
SCR stack. The value of the SCR stack is copied to the top of the logic stack
so that boxes or output coils can be tied directly to the left power rail without
an intervening contact.
The Sequence Control Relay Transition (SCRT) instruction identifies the
SCR bit to be enabled (the next n bit to be set). When power flows to the coil
or FBD box, the referenced n bit is turned on and the n bit of the LSCR
instruction (that enabled this SCR segment) is turned off.
The Sequence Control Relay End (SCRE) instruction marks the end of an
SCR segment.
NETWORK 1
// On the first scan enable State 1
LD SM0.1
S S0.1 1
NETWORK 2
// Beginning of State 1 control region
LSCR S0.1
NETWORK 3
// Control the signals for Street 1
LD SM0.0
S Q0.4 1 // Set: Turn on the red light
R Q0.5 2 // Reset: Turn off the yellow and green lights
TON T37 +20 // Start a 2-second timer
NETWORK 4
// After a 2 second delay, transition to State 2
LD T37
SCRT S0.2
NETWORK 5
// End of SCR region for State 1
SCRE
NETWORK 6
// Beginning of State 2 control region
LSCR S0.2
NETWORK 7
// Control the signals for Street 2
LD SM0.0
S Q0.2 1 // Set: Turn on the green light
TON T38 +250 // Start a 25-second timer
NETWORK 8
// After a 25 second delay, transition to State 3
LD T38
SCRT S0.3
NETWORK 9
// End of SCR region for State 2
SCRE
LAD
Types of Logical Control Flow
Sequential Control
A process with a well-defined sequence of steps is easy to model with SCR segments. For example, consider a cyclical
process, with 3 steps, that should return to the first step when the third has completed.
State L
Transition Condition
State M
Transition Condition
State N
Transition Condition
Divergence Control
In many applications, a single stream of sequential states must be split into two or more different streams. When a stream
of control diverges into multiple streams, all outgoing streams must be activated simultaneously, as shown in the following
diagram:
State L
Transition Condition
State M State N
LAD
Convergence Control
A situation similar to divergence control arises when two or more streams of sequential states must be merged into a
single stream. When multiple streams merge into a single stream, they are said to converge. When streams converge, all
incoming streams must be complete before the next state is executed. The following diagram illustrates convergence:
State L State M
Transition Condition
State N
NETWORK 1
// Beginning of State L control region
LSCR S3.4
NETWORK 2
// Transition to State L'
LD V100.5
SCRT S3.5
NETWORK 3
// End of SCR region for State L
SCRE
NETWORK 4
// Beginning of State M control region
LSCR S6.4
NETWORK 5
// Transition to State M'
LD C50
SCRT S6.5
NETWORK 6
// End of SCR region for State M
SCRE
NETWORK 7
LD S3.5 // When both State L'
A S6.5 // and State M' are actived then:
S S5.0 1 // Enable State N
R S3.5 1 // Reset State L'
R S6.5 1 // Reset State M'
LAD
Divergence of a Control Stream, Depending on the Transition Condition
In other situations, a control stream may bre directed into one of several possible control streams, depending upon which
transition condition comes true first. Such a situation is shown below.
STL
NETWORK 1
// Beginning of State L control region
LSCR S3.4
NETWORK 2
// Transition to State M
LD M2.3
SCRT S3.5
NETWORK 3
// Transition to State N
LD I3.3
SCRT S6.5
NETWORK 4
// End of SCR region for State L
SCRE
LAD