Menu
CoddyTech

Amber Before Red

Part of the Timers section of Coddy's PLC Programming journey. Lesson 14 of 18.

Cars cannot stop the moment the light changes. Between green and red comes amber, long enough for a car to stop safely.

A TON on Req times the amber. Amber is lit while Req is on and the timer is not done; red takes over when it is:

Amber goes out and red lights in the same scan, so the cars always see one lamp.

challenge icon

Challenge

Medium

After a press, the cars get Amber for 3 s, then Red. Amber goes out when Red lights.

Try it yourself

{"v":1,"lang":"ld","tags":[{"name":"Req","type":"BOOL"}],"rungs":[{"els":[{"t":"no","tag":"WalkButton"},{"t":"set","tag":"Req"}]},{"els":[{"t":"nc","tag":"Req"},{"t":"coil","tag":"Green"}]},{"els":[{"t":"no","tag":"Req"},{"t":"coil","tag":"Red"}]},{"els":[{"t":"nc","tag":"Walk"},{"t":"coil","tag":"DontWalk"}]}]}

All lessons in Timers

Practice on your own: PLC playground