3D VIEW
HOW IT WORKS · LIVEThree timers = one traffic light. This is the classic first PLC timer project, written here in ladder (LAD) for a Siemens S7-1200.
Tag table
| Tag | Address | Meaning |
|---|---|---|
| START | %I0.0 | Start push-button (NO) |
| STOP_OK | %I0.1 | Stop push-button, wired NC (1 = healthy) |
| RED · YELLOW · GREEN | %Q0.0 · %Q0.1 · %Q0.2 | Lamps |
| RUN | %M0.0 | Sequence running |
| T_RED · T_GREEN · T_YEL | %DB1 · %DB2 · %DB3 | TON timers: 4 s, 3 s, 2 s |
The seven networks
| Network | Logic |
|---|---|
| 1 · Start / Stop (seal-in) | (START OR RUN) AND STOP_OK → RUN |
| 2 · Red time (TON 4 s) | RUN AND NOT T_YEL.Q → T_RED, PT T#4s |
| 3 · RED lamp | RUN AND NOT T_RED.Q → RED %Q0.0 |
| 4 · Green time (TON 3 s) | T_RED.Q → T_GREEN, PT T#3s |
| 5 · GREEN lamp | T_RED.Q AND NOT T_GREEN.Q → GREEN %Q0.2 |
| 6 · Yellow time (TON 2 s) | T_GREEN.Q → T_YEL, PT T#2s |
| 7 · YELLOW lamp | T_GREEN.Q AND NOT T_YEL.Q → YELLOW %Q0.1 |
How it runs
- START (%I0.0) pressed → RUN (%M0.0) latched through its seal-in contact.
- T_RED (TON 4 s) runs → RED %Q0.0 = 1.
- T_RED done → T_GREEN (3 s) starts → GREEN %Q0.2 = 1 (RED goes off because T_RED.Q is now 1).
- T_GREEN done → T_YEL (2 s) starts → YELLOW %Q0.1 = 1.
- T_YEL done → T_RED restarts: the cycle repeats. T_YEL.Q opens network 2, T_RED resets, which resets T_GREEN and T_YEL, and on the next scan T_RED times again from zero.
- STOP pressed → STOP_OK = 0 → its NO contact opens → RUN reset → all outputs OFF and all timers reset.
Result: RED 4 s → GREEN 3 s → YELLOW 2 s, a 9-second cycle.
Common mistakes
- Driving a lamp straight from a timer Q bit without “AND NOT next timer” – two lamps light together.
- Using the same timer DB twice in the program.
- Expecting a TON to remember its time when the input drops – it resets; use a TONR if you need that.
A real road junction needs conflict monitoring, lamp-failure detection and certified controllers – this example teaches the timer logic.
Members Edition reference card
A two-page A4 edition prepared in your name: a gold-framed cover with our verification seal, plus a reference sheet with the key points, the field checklist or key data, the standards and a QR code back to the full article.
Free account · takes 30 seconds · no password
Need help on site? Automation Nodes designs, builds, tests and commissions LT panels, automation and electrical installations across India.