Menu
CoddyTech

Night Mode

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

At night, with little traffic, many crossings switch off the cycle. The car signal flashes amber, which means "go with care", and every other lamp is dark.

Add a flasher that runs only while Night is on. A flasher that always runs, like the fault lamp's, works too, with Night in series with its output. Then give every lamp rung a normally closed Night, and let the flasher light Amber on a second path:

A press at night should do nothing, so Night also stops the button from setting Req, and resets it.

challenge icon

Challenge

Hard
  • with Night on, Amber flashes 0.5 s on, 0.5 s off
  • every other lamp is dark, and WalkButton does nothing
  • with Night off, the crossing works as before

Try it yourself

{"v":1,"lang":"ld","tags":[{"name":"Req","type":"BOOL"},{"name":"T1","type":"TON"},{"name":"T2","type":"TON"},{"name":"T3","type":"TON"}],"rungs":[{"els":[{"t":"no","tag":"WalkButton"},{"t":"set","tag":"Req"}]},{"els":[{"t":"no","tag":"Req"},{"t":"TON","inst":"T1","pt":"T#3s"}]},{"els":[{"t":"no","tag":"T1.Q"},{"t":"TON","inst":"T2","pt":"T#5s"}]},{"els":[{"t":"no","tag":"T2.Q"},{"t":"TON","inst":"T3","pt":"T#2s"}]},{"els":[{"t":"nc","tag":"Req"},{"t":"coil","tag":"Green"}]},{"els":[{"t":"no","tag":"Req"},{"t":"nc","tag":"T1.Q"},{"t":"coil","tag":"Amber"}]},{"els":[{"t":"no","tag":"T1.Q"},{"t":"coil","tag":"Red"}]},{"els":[{"t":"no","tag":"T1.Q"},{"t":"nc","tag":"T2.Q"},{"t":"coil","tag":"Walk"}]},{"els":[{"t":"nc","tag":"Walk"},{"t":"coil","tag":"DontWalk"}]},{"els":[{"t":"no","tag":"Req"},{"t":"nc","tag":"T1.Q"},{"t":"coil","tag":"Wait"}]},{"els":[{"t":"no","tag":"T3.Q"},{"t":"reset","tag":"Req"}]}]}
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Timers

Practice on your own: PLC playground