Traffic Lights

ReXoR

Member
Join Date
Jan 2004
Posts
2
Hi, everybody.
Well, I know traffic lights are a very "hot" subject (especially when students are posting, but I have tried to find some way to make traffic lights for the program we're using at school (Sucosoft S40), so I was wondering if someone could paste the program code for a sample traffic light (it doesn't need to be anything advanced. It could just be 1 single light going green for 10 secs, then yellow for 5, then red.

I just need to understand how I will have to deal with the timers.
I've tried for a couple of hours, read a few websites, but I didn't get much out of them..

(what I mean by program code is such as:)

Code:
PROGRAM test
VAR
	Button1 AT %I0.0.0.0.0:	bool;
	Button2 AT %I0.0.0.0.1:	bool;
	Output AT %Q0.0.0.0.0:	bool;
END_VAR

LD	Button1
OR	Output
ANDN	Button2
ST	Output
END PROGRAM

Hope anyone of you have experience with Sucosoft S40 (and are willing to help me out (o: )

And by the way; the PLC I'm using is a PS4-151-MM1
 
Last edited:
Go to the top of the page and hit the 'LEARN PLC' link.

While you won't be spoon fed the answer, it does cover timers in enough detail that you should be able to finish your homework.

Doug
 
so you did read the first ten pages of the manual, just carry on and you will learn how to program a timer on the next page.
 
I know how to program timers, but I need some pointers in programming traffic lights :/ Barely done any PLS before.
I'm not asking you to do my homeworks or something, but I'm asking you for a little assistance (o;
 
ReXoR

Did you search this site for previous traffic light examples?

If you did, you would have come across a few that had been posted, but not for your specific PLC.

Have a look at the links below, they might give you a clue as to how to go about programming yours.

This Post

And This One

And Possibly This One

That should get your old grey matter churning

Paul
 
ReXoR said:
I know how to program timers, but I need some pointers in programming traffic lights :/ Barely done any PLS before.
I'm not asking you to do my homeworks or something, but I'm asking you for a little assistance (o;

ReXoR, they hate traffic light questions here. Really, really, hate them.


So, anyways...

Start with three timers. Have the first timer run "freely" (meaning that it needs no conditions to run). Set the preset for, oh, three seconds (the troubleshooting will take less time this way).

For the second timer, use the "done" bit from the first timer as the permissive (what makes it run). Set this preset to 1 second.

Third timer. Use the "done" bit from the second to run it, this is known as "cascading timers". Set the preset to 2 seconds.

Not knowing anything about a "Sucosoft S40", I wouldn't know how one would go about resetting the timers. But in any case, once timer #3 times out, reset all three.


Now you have a program with three timers that once loaded into your PLC will continually cycle from timers 1,2,3.

As an exercise to the reader (you), use a bit pattern from the three timers to control the outputs to the lights.

Should be obvious...


According to this guy they don't use PLCs for traffic light anyways:

http://www.plctalk.net/qanda/arch/topic/447.html

"No PLCs were used. Traffic lights have their own speciallized circuit boards, deidicated to the task. Lots of vendors, models, and options, depending on how 'intelligent' you need them to be."

So why bother? Just pass that along to your instructor. :)


Or just look here:

http://plcguide.mrplc.com/index.html


John
 
ReXoR,

Search this fine site for the term traffic light. You'll find plenty of links. One of them even has a drawing of a Sequential Function Chart (SFC - aka Grafcet) of one. I know, I posted it.

BUT PUT SOME EFFORT IN AND SEARCH YOURSELF!

And yes, rootboy: we hate traffic lights questions. Mainly because people who are asking about them seem to be too lazy to do their work on their own! Or is there another reason why the same old questions keep popping up over and over again?
 
Last edited:
jvdcande said:
ReXoR,

Search this fine site for the term traffic light. You'll find plenty of links. One of them even has a drawing of a Sequential Function Chart (SFC - aka Grafcet) of one. I know, I posted it.

BUT PUT SOME EFFORT IN AND SEARCH YOURSELF!

I remember someone (you?) creating a nice one for this site and even had a special link to it. Or was I dreaming? It's been awhile...


And yes, rootboy: we hate traffic lights questions. Mainly because people who are asking about them seem to be too lazy to do their work on their own! Or is there another reason why the same old questions keep popping up over and over again?

Well, yeah, it's on the Syllabus :p


John
 
You must be bored!

Casey,

You must be bored if you are reading through posts from 2 years ago!

Either that or you are thinking about doing a traffic light assignment and need some help with it o_O

Paul
 
PLucas said:
Casey, You must be bored if you are reading through posts from 2 years ago! Either that or you are thinking about doing a traffic light assignment and need some help with it o_O
Paul

Not bored, just searching for info on Moeller software.

At least they weren't a "One Post Wonder".

Did just notice a thread started in 2002 that just resurfaced, and haven't figured why, yet.

regards.....kc
 
Last edited:
I get the frustration with students. I REALLY do. Let me lay this out to you... I have NO text book, I have a teacher who has never (yes, litterally) lectured or spoke on the logic process leading to a good program. I have written an karnaugh map. would you like yo see? I have tried many ways in which to solve the primer that is the traffic light in 2 directions further i have spent most of this morning reading the many threads in this and other forums.
I have gotten to the piont where i have 4 timers 2 @ 8 seconds and 2 @ 4 seconds trying to run reds @ 12 seconds Greens @ 8 seconds and yellos @ 4 seconds. I am stuck with how to get the Reds to swap, i am writting in RSlogix and would apriciate not being graded on spelling(i am addicted to spellcheck wich is not currently available) and would ask for some direction into how to think my way out of this box.
 
It sounds like you are getting pretty close. You are head and shoulders above most of the students that post here!

I am going to assume that you have separte outputs for each red.

There are lots of ways to do this. One way is to have a status bit (flag coil and contacts) that indicate which direction is green. You can use NC or NO contacts in series and paralell to have the timer trip the correct light.
 
finisherusa said:
(i am addicted to spell check which is not currently available) .


I am the worlds worst speller..But do a google search on ie spell check..There is a dandy little program out there for on line spell checks..it uses the word dictionary so if you don't have word then don't bother..as for the traffic lights..I do feel your pain..I remember seeing people struggle with this one..

I must admit this was not a challenge for me..I finished the simple traffic light and the advanced green in the first 30 min class..dont know why but it just didn't seem that hard...

Perhaps you are trying to make it more complicated than it is ..(that is in your head..)

Try writing the sequence down first.. then only look at one set..program that one set and get it working..then copy the code (But with different I/O designations) and then add in your conditions..such as if traffic a=red the b= green..if a=green then b=red.. However saying that use the conditions as a start point..not a direct comparison..otherwise you will have a wreck on your hands... The other point i will make is have fun..As you can see here most people have a great sense of humor and are more than willing to help those who help themselves..


BTW post your code..I and i am sure many others will be more than willing to try and help you out..However..dont post if you cant take a little bit of good natured ribbing..or constructive criticism..

D
 

Similar Topics

I am currently am in a PLC class and need urgent help on how the ladder logic would be laid out. I understand how to get the traffic lights to...
Replies
19
Views
434
Hi all, I need help to create this program I have problems with the flasher. Develop the program below using RSLogix 500 software. Be sure to...
Replies
10
Views
845
Hello everyone... I am new to the PLC world and I would really love it if you gave me some interest about the problem I am dealing with for about...
Replies
15
Views
4,044
Good afternoon, I am studying my HNC and we have PLC classes. I am a beginner, the course has started in August and we are going to have an...
Replies
15
Views
3,843
Hi totally new to plc programming Would anyone have a zelio program for the below they could share, or any assistance would be helpful On signal...
Replies
11
Views
3,676
Back
Top Bottom