Basic
4 min

Traffic Light 02 — Manual Red/Yellow/Green

beginnertraffic-lightfundamentalscontactcoil

Ready to build this?

Sign up free — no credit card required. This scenario requires the Basic plan.

Sign up to play this scenario →

Already have an account? Log in

Traffic Light 02 — Manual Red/Yellow/Green

Briefing

Wire three switches straight to the North-South lamps. No timing yet — just direct control, to prove you can drive each lamp independently before automating the sequence. All three lamps can be on at once here — that's expected; the interlock comes in later stages.

Objectives

  • RED_SW controls NS_RED independently
  • YEL_SW controls NS_YEL independently
  • GRN_SW controls NS_GRN independently

Hints

  • Each switch gets its own rung — three separate contact→coil rungs.
  • No interlock needed yet: it is fine for all three lamps to be on together.

I/O Table

Inputs

RED_SW

Manual red switch

BOOL · %I0.0

YEL_SW

Manual yellow switch

BOOL · %I0.1

GRN_SW

Manual green switch

BOOL · %I0.2

Outputs

NS_RED

North-South red lamp

BOOL · %Q0.0

NS_YEL

North-South yellow lamp

BOOL · %Q0.1

NS_GRN

North-South green lamp

BOOL · %Q0.2

Your program will be tested against:

All test cases run automatically when you submit. Assertions are hidden until you pass.

  1. #1Each switch drives its own lamp

    Flipping a switch lights only its matching lamp; all three can be on together

  2. #2All switches off → all lamps off

    Releasing every switch turns off every lamp

Ready to build this?

Sign up free — no credit card required. This scenario requires the Basic plan.

Sign up to play this scenario →

Already have an account? Log in

Runnable simulator field guide

Manual traffic-light PLC scenario: test checklist

Direct answer

The learner can ensure only the permitted color is active, explain simultaneous-command policy and test every state from a known initial condition.

Written for pLC beginners learning Boolean selection, output exclusivity, command priority and observable lamp state.

a traffic-signal sequence training panel with manual controls, three lamp states, PLC I/O and reviewable test evidence while studying manual red, yellow and green output selection with mutual exclusion and deterministic priority
System map / 02

NODE 01observable

Scenario setup

Manual red, yellow and green commands, enable state, priority, mutual exclusion, final outputs, lamp feedback and reset state.

NODE 02observable

I/O and state map

Operator selection through input image, arbitration logic, final output owner, modeled lamp state and independent observed color.

NODE 03observable

Normal run

Each single command producing the intended exclusive lamp state with off and reset conditions verified.

NODE 04observable

Boundary run

Two or three commands together, held command, command change during scan, enable loss, stuck output, restart and undefined selection.

NODE 05observable

Injected fault

A command, arbitration, priority, final-writer, output, lamp-model or observed-state mismatch.

NODE 06observable

Target check

The learning pattern retained as a regression truth table and any real application designed to its own approved requirements.

Answer surface / 07

How do I prevent multiple traffic lights turning on in PLC logic?

Give the lamp state one owner and define explicit arbitration or a state variable so simultaneous commands resolve deterministically instead of relying on incidental rung order.

What should happen if red and green are selected together?

The requirement must state a safe deterministic result—commonly red priority or an invalid-command state. Test that case directly.