Traffic Intersection Simulation for ProLogix

Here is my implementation of the traffic intersection exercise for ProLogix.  Some people use SQO's but when you have to alter how the program runs due to random inputs like a pedestrian push button that can occur at anytime it has it's limits.

My program uses a single timer and each light has a designated time interval in which it is lit.  The random inputs like pedestrians pushing the button or a car entering a loop while the light is red simply alters the timing.  There is one functionality that I still need to implement in the program and that is when you push the pedestrian button it needs to "hold" over until the next cycle if you press it too late.  What I have here should be sufficient for you guys to get some ideas though that doesn't involve SQO's or multiple timers.  Though I will admit multiple timers would probably be more versatile.

Inputs:

  1. North West Crossing Button
  2. North East Crossing Button
  3. North West Loop
  4. North East Loop
Outputs:

  1. NW Red Light
  2. NW Yellow Light
  3. NW Green Light
  4. NW Crossing Signal
  5. NE Red Light
  6. NE Yellow Light
  7. NE Green Light
  8. NE Crossing Signal


*Note I forgot to delete the last unused rung and normally I break this into multiple ladders instead of one giant file.


Comments