PLC AutomationDirect DL06 User Manual page 557

Micro plc
Table of Contents

Advertisement

Learning to Draw State Transition Diagrams
Introduction to Process States
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.
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.
The Need for State Diagrams
Sometimes we need to forget about the scan nature of a PLC, 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!
A 2–State Process
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.
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.
Chapter 7: RLL
DL06 Micro PLC User Manual, 3rd Edition, Rev. G
Stage Programming
PLUS
Ladder
Inputs
Program
1) Read
Execute
Execute
2) Read
3) Read
(Etc.....)
Inputs
ON
X0
Ladder
Y0
OFF
Program
X1
Transition condition
State
X0
OFF
X1
Output equation: Y0 = On
Outputs
Write
Write
Outputs
Motor
ON
7-3

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AutomationDirect DL06 and is the answer not in the manual?

Questions and answers

Table of Contents