Hi all,
Yes this is the "good ol' traffic light" problem. I've done a lot of searching on this site, and i don't want THE answer, because i know it can be done a million different ways. What i'm looking for is some guidance in getting it to work a specific way, to better help me understand the logic behind it. This may be a long read so bare with me.
I'm three weeks into an intro to PLC class, and i have a worthless instructor. He has showed us normally open, normally closed, and how to create a seal in. Now we've already hit the traffic light problem and i'm stuck. If you go by the book, you start out with just three lights on three different timers; red, amber, green. Then you move to six lights. Now, the book shows you how to add a fourth timer (for the other green) to make all six work. Below is a pic of the ladder, and the .rls file.
View attachment trafficbook.rsl.zip
Notice the first timer is for the red light. I've seen on this forum that most solutions involve timers for the amber, green, and green delay. While that makes good sense and all, it's not how the book shows, and i'm trying to stay on the path. It took me a while to figure how the fourth timer comes into play, but i've watched it enough now to make sense of it.
And this is where my problem comes in. The book says you can add two more timers to get a two second time period where both lights are red. Seems this forum calls it a green delay. Now i could start over from scratch and have six timers, and three different times, but i don't think the book is suggesting this. Keep in mind this is supposed to be a cascading type timer thingy. My instructor won't answer my questions without suggesting i draw a timeline and a bunch of ****, and basically start all over. I'm trying to build on what i already have. So i've added a fifth timer and have the green delay working on one side...
View attachment trafficbookwithonedelay.rsl.zip
I felt good to at least get one side working without any help. But i do need help getting the other delay to work. Every time i throw a sixth timer in there, everything goes crazy. I would really appreciate some direction from here. Also, i'm only using enable and done bits. i'm hoping this will help me get a better grasp of the logic. If you made it this far, i really appreciate your time. And i hope i've made this not just another traffic light post, although i'm sure someone will chime in and say otherwise.
Thanks
Wes
Yes this is the "good ol' traffic light" problem. I've done a lot of searching on this site, and i don't want THE answer, because i know it can be done a million different ways. What i'm looking for is some guidance in getting it to work a specific way, to better help me understand the logic behind it. This may be a long read so bare with me.
I'm three weeks into an intro to PLC class, and i have a worthless instructor. He has showed us normally open, normally closed, and how to create a seal in. Now we've already hit the traffic light problem and i'm stuck. If you go by the book, you start out with just three lights on three different timers; red, amber, green. Then you move to six lights. Now, the book shows you how to add a fourth timer (for the other green) to make all six work. Below is a pic of the ladder, and the .rls file.
View attachment trafficbook.rsl.zip
Notice the first timer is for the red light. I've seen on this forum that most solutions involve timers for the amber, green, and green delay. While that makes good sense and all, it's not how the book shows, and i'm trying to stay on the path. It took me a while to figure how the fourth timer comes into play, but i've watched it enough now to make sense of it.
And this is where my problem comes in. The book says you can add two more timers to get a two second time period where both lights are red. Seems this forum calls it a green delay. Now i could start over from scratch and have six timers, and three different times, but i don't think the book is suggesting this. Keep in mind this is supposed to be a cascading type timer thingy. My instructor won't answer my questions without suggesting i draw a timeline and a bunch of ****, and basically start all over. I'm trying to build on what i already have. So i've added a fifth timer and have the green delay working on one side...
View attachment trafficbookwithonedelay.rsl.zip
I felt good to at least get one side working without any help. But i do need help getting the other delay to work. Every time i throw a sixth timer in there, everything goes crazy. I would really appreciate some direction from here. Also, i'm only using enable and done bits. i'm hoping this will help me get a better grasp of the logic. If you made it this far, i really appreciate your time. And i hope i've made this not just another traffic light post, although i'm sure someone will chime in and say otherwise.
Thanks
Wes