PLC Program to Control Traffic Lights and Pedestrian Lights
This is a PLC Program to Control Traffic Lights and Pedestrian Lights.
Problem Description
Implement controlling of Traffic Lights and Pedestrian Lights using PLC in Ladder Diagram programming
language.
Problem Solution
As we have solved Traffic Lights problem, similarly we can solve this problem using Sequencer Output SQO
instruction.
In this program, two bits and outputs are added.
File length, Control, File and Destination remain same.
Mask data changes due to 2 added outputs.
As 2 outputs are added, Mask will now have value 00FFh as total number of bits used are 8. In order to pass
all 8bits, data flow is masked with 11111111 and moved to output.
When Green light of South-North is ON, Pedestrian Light and Red light of East-West should be ON and
vice-versa.
Use Coil to Master Start and Stop the entire process.
While using ordinary method to Master Start and Stop, when stop is pressed, the process is just paused and
is not entirely reset, hence resetting of Position in SQO instruction and Outputs using the same Stop PB can be
done manually.
PLC Program
Here is PLC program to Control Traffic Lights and Pedestrian Lights, along with program explanation and
run time test cases.
List of Inputs and Outputs
I:1/0
=
Start
(Input)
I:1/1
= Stop
(Input)
B3:0/0 = Latched Coil Bit
(Bit)
T4:0
= Timer to update output sequence (Timer)
SQO
=
Sequencer output
(Sequencer)
O:2/0
= North-South Green Light
(Output)
O:2/1
=
North-South Yellow Light
(Output)
O:2/2
= North-South Red Light
(Output)
O:2/3
=
East-West Green Light
(Output)
O:2/4
= East-West Yellow Light
(Output)
O:2/5
=
East-West Red Light
(Output)
O:2/6
= South-North Pedestrian Light
(Output)
O:2/7
=
East-West Pedestrian Light
(Output)