RLL
P
LUS
Stage
Programming
7--3
RLL
PLUS
Stage Programming
DL105 PLC User Manual, 3rd Edition
Learning to Draw State Transition Diagrams
Those familiar with ladder program
execution know that the CPU must scan
the ladder program repeatedly, over and
over. Its three basic steps are:
1. Read the inputs
2. Execute the ladder program
3. Write the outputs
The benefit is that a change at the inputs
can affect the outputs in just a few
milliseconds.
Ladder
Program
Inputs
Outputs
1) Read
Execute
Write
PLC Scan
Execute
Write
(etc....)
2) Read
3) Read
Most manufacturing processes consist of a series of activities or conditions , each
lasting for several seconds. minutes, or even hours. We might call these “process
states”, which are either active or inactive at any particular time. A challenge for RLL
programs is that a particular input event may last for just a brief instant. We typically
create latching relays in RLL to preserve the input event in order to maintain a
process state for the required duration.
We can organize and divide ladder logic into sections called “stages”, representing
process states. But before we describe stages in detail, we will reveal
the secret to
understanding stage programming:
state transition diagrams.
Sometimes we need to forget about the scan nature of PLCs, and focus our thinking
toward the states of the process we need to identify. Clear thinking and concise
analysis of an application gives us the best chance at writing efficient, bug-free
programs.
State diagrams are just a tool to help us draw a picture of our process!
You’ll discover that if we can get the picture right,
our program will also be right!
Consider the simple process shown to the
right, which controls an industrial motor.
We will use a green momentary SPST
pushbutton to turn the motor on, and a red
one to turn it off. The machine operator will
press the appropriate pushbutton for just a
second or so. The two states of our
process are ON and OFF.
The next step is to draw a
state transition
diagram
, as shown to the right. It shows
the two states OFF and ON, with two
transition lines in-between. When the
event X0 is true, we transition from OFF to
ON. When X1 is true, we transition from
ON to OFF.
Ladder
Program
Inputs
Outputs
On
Off
Motor
X0
X1
Y0
OFF
ON
X0
X1
Output equation: Y0 = ON
State
Transition condition
If you’re following along, you are very close to grasping the concept and the
problem-solving power of state transition diagrams. The output of our controller is
Y0, which is true any time we are in the ON state. In a boolean sense, Y0=ON state.
Next, we will implement the state diagram first as RLL, then as a stage program. This
will help you see the relationship between the two methods in problem solving.
Introduction to
Process States
The Need for State
Diagrams
A 2--State Process
Summary of Contents for DL105
Page 2: ...DL105 PLC User Manual Manual Number D1 USER M...
Page 308: ...1B DL105 Error Codes In This Appendix Error Code Table...
Page 314: ...1C Instruction Execution Times In This Appendix Introduction Instruction Execution Times...
Page 324: ...1D Special Relays In This Appendix DL105 PLC Special Relays...
Page 327: ...1E PLC Memory In This Appendix DL105 PLC Memory...