RLL
P
LUS
Stage
Programming
7--8
RLL
PLUS
Stage Programming
DL105 PLC User Manual, 3rd Edition
Stage Program Example: Toggle On/Off Lamp Controller
In the process shown to the right, we use
an ordinary momentary pushbutton to
control a light bulb. The ladder program
will latch the switch input, so that we will
push and release to turn on the light, push
and release again to turn it off (sometimes
called toggle function). Sure, we could just
buy a mechanical switch with the alternate
on/off action built in... However, this
example is educational and also fun!
Next we draw the state transition diagram
.
A typical first approach is to use X0 for
both transitions (like the example shown
to the right). However,
this is incorrect
(please keep reading).
Ladder
Program
Inputs
Outputs
Toggle
X0
Y0
OFF
ON
X0
X0
Output equation: Y0 = ON
Powerup
Note that this example differs from the motor example, because now we have just
one pushbutton. When we press the pushbutton, both transition conditions are met.
We would just transition around the state diagram at top speed. If implemented in
stage, this solution would flash the light on or off each scan (obviously undesirable)!
The solution is to make the the push and the release of the pushbutton separate
events. Refer to the new state transition diagram below. At powerup we enter the
OFF state. When switch X0 is pressed, we enter the Press-ON state. When it is
released, we enter the ON state. Note that X0 with the bar above it denotes X0 NOT.
When in the ON state, another push and
release cycle similarly takes us back to the
OFF state. Now we have two unique states
(OFF and ON) used when the pushbutton is
released, which is what was required to solve
the control problem.
The equivalent stage program is shown to the
right. The desired powerup state is OFF, so
we make S0 an initial stage (ISG). In the ON
state, we add special relay contact SP1,
which is always on.
Note that even as our programs grow more
complex, it is still easy to correlate the state
transition diagram with the stage program!
S1
X0
JMP
ISG
S0
S2
JMP
SG
S1
OUT
Y0
OFF State
SP1
S3
X0
JMP
SG
S2
SG
S3
X0
S0
JMP
X0
Push--On State
ON State
Push--Off State
X0
Push--ON
ON
Push--OFF
OFF
Powerup
X0
X0
X0
Output equation: Y0 = ON
Output
A 4--State Process
Содержание DL105
Страница 2: ...DL105 PLC User Manual Manual Number D1 USER M...
Страница 308: ...1B DL105 Error Codes In This Appendix Error Code Table...
Страница 314: ...1C Instruction Execution Times In This Appendix Introduction Instruction Execution Times...
Страница 324: ...1D Special Relays In This Appendix DL105 PLC Special Relays...
Страница 327: ...1E PLC Memory In This Appendix DL105 PLC Memory...
Страница 329: ...1F European Union Directives CE In This Appendix European Union EU Directives Basic EMC Installation Guidelines...