Skip to content
Ladder logic (PLC) templates

Ladder - Signalled Junction Sequence

Eight rungs freeze a junction two seconds into its four-second amber: the 30 s green TON is done, the amber TON is still timing, the 25 s red TON has never been enabled, so only the amber lamp is lit and the engine names the green lamp, the red lamp and the unstarted red timer as never energised at this instant.

Template previewLadder logic (PLC)
Signalled junction - three-phase lamp sequenceDECLARED INPUT STATEPower_On = 1Ped_Button = 1L1N1Master enableTRUEPower_On1Seq_Run12Green phase, 30 s, timed outTRUESeq_Run1TONT_GreenPRE 30 sACC 30 sDN3Amber phase, 4 s, armed by the green done bitTRUET_Green.DN1TONT_AmberPRE 4 sACC 2 sDN4Red phase, 25 s, armed by the amber done bitFALSET_Amber.DN0TONT_RedPRE 25 sACC 0 sDN5Green lamp holds until the green timer times outFALSESeq_Run1T_Green.DN1Lamp_Green06Amber lamp between green done and amber doneTRUET_Green.DN1T_Amber.DN0Lamp_Amber17Red lamp from amber done until red doneFALSET_Amber.DN0T_Red.DN0Lamp_Red08Pedestrian request seals in on the button and clears...TRUEPed_Button1Ped_Waiting0Lamp_Red0Ped_Waiting18 rungs solved in one scan: 5 true, 3 false. 19 tags, 2 declared as inputs.3 outputs are never energised in this state: 'T_Red', 'Lamp_Green', 'Lamp_Red'.

Make it your own.

title "Signalled junction - three-phase lamp sequence"
state: Power_On, Ped_Button

rung "Master enable"
  --] [--Power_On----( )--Seq_Run

rung "Green phase, 30 s, timed out"
  xic Seq_Run
  ton T_Green preset: 30 accum: 30 unit: s

rung "Amber phase, 4 s, armed by the green done bit"
  xic T_Green.DN
  ton T_Amber preset: 4 accum: 2 unit: s

rung "Red phase, 25 s, armed by the amber done bit"
  xic T_Amber.DN
  ton T_Red preset: 25 accum: 0 unit: s

rung "Green lamp holds until the green timer times out"
  xic Seq_Run
  xio T_Green.DN
  ote Lamp_Green

rung "Amber lamp between green done and amber done"
  xic T_Green.DN
  xio T_Amber.DN
  ote Lamp_Amber

rung "Red lamp from amber done until red done"
  xic T_Amber.DN
  xio T_Red.DN
  ote Lamp_Red

rung "Pedestrian request seals in on the button and clears on red"
  branch
    --] [--Ped_Button
    --] [--Ped_Waiting
  --]/[--Lamp_Red
  --( )--Ped_Waiting