Time-driven sequencer application example, E–25 – Rockwell Automation 1761-HHP-B30 MicroLogix 1000 with Hand-Held Programmer (HHP) User Manual

Page 468

Advertising
background image

Appendix E
Application Example Programs

E–25

The following application example illustrates the use of the TON and SQO
instructions in a traffic signal at an intersection. The timing requirements
are:

Red light – 30 seconds

Yellow light – 15 seconds

Green light – 60 seconds

The timer, when it reaches its preset, steps the sequencer that in turn controls
which traffic signal is illuminated. For a detailed explanation of:

LD, LDI, and TON instructions, see chapter 8.

SQO and SQC instructions, see chapter 13.

Time Driven Sequencer Ladder Program

Rung 2:0
The function of this rung is called a regenerative timer. Every time the
timer reaches its preset, the DONE bit is set for one scan––this causes
this rung to become FALSE for one scan and resets the timer. On the
following scan, when this rung becomes TRUE again, the timer begins
timing.

| Timer Timer |
| Enable |
| T4:0 +TON–––––––––––––––+ |
|–––]/[–––––––––––––––––––––––––––––––––––––+TIMER ON DELAY +–(EN)–|
| DN |Timer T4:0+–(DN) |
| |Time Base 0.01| |
| |Preset 1| |
| |Accum 0| |
| +––––––––––––––––––+ |

Rung 2:1
Controls the RED, GREEN, and YELLOW lights wired to outputs O:0/0 – O:0/2
and controls how long the regenerative timer times between each step.
When this rung goes from false-to-true (by the timer reaching its preset),
the first sequencer changes which traffic light is illuminated and the
second sequencer changes the preset of the timer to determine how long
this next light is illuminated.

| RED, GREEN, and |
| YELLOW lights |
| T4:0 +SQO–––––––––––––––+ |
|––] [––––––––––––––––––––––––––––––––––+–+SEQUENCER OUTPUT +–(EN)–+–|
| DN | |File #N7:0+–(DN) | |
| | |Mask 0007+ | |
| | |Dest O:0.0| | |
| | |Control R6:0| | |
| | |Length 3| | |
| | |Position 0| | |
| | +––––––––––––––––––+ | |
| | Timer Presets | |
| | for each lights | |
| | +SQO–––––––––––––––+ | |
| +–+SEQUENCER OUTPUT +–(EN)–+ |
| |File #N7:5+–(DN) |
| |Mask FFFF| |
| |Dest T4:0.PRE| |
| |Control R6:1| |
| |Length 3| |
| |Position 0| |
| +––––––––––––––––––+ |

Rung 2.2

| |
|–––––––––––––––––––––––––––––––––––––+END+–––––––––––––––––––––––––––|
| |

Time-Driven Sequencer
Application Example

Advertising