I expanded on my idea from my previous attempt to make this problem work. I think I am closer now although it still confuses me some but I guess practice will make things easier. I should make notes on what each rung does so I can better understand it that way. lemme know what you guys think of it. I think I need to adjust some time values still.
You still need to re-evaluate the purpose of your timer, and when it needs to run.
What is your
INITIAL STATE? (i.e. no cars present on crossing street). What is the state of each output (lights) and what is the state of your lone input (I:1/8, the traffic sensor)? In this state, do you want the timer to run, or lights to change?
After you have answered these questions, ask yourself what happens when a car approaches the intersection from the crossing street. What
IMMEDIATELY happens to the state of the traffic input? What do you want to
IMMEDIATELY happen to the lights? If nothing, how long before changes occur?
Answering these questions on paper should get you well on your way to writing a program that will solve the word problems from your lab sheet.
Hint: You do only need one timer. You just have to decide when to run it, off of what condition, and whether you need some type of "memory" on that condition.
raydog26 said:
Indeed, I wish that was something they spent more time teaching because right now its learn as you go with that.
I hate to say it, but it's ALWAYS going to be "learn as you go with that." Don't count on any instructor being able to teach you how to problem-solve. Don't blame an instructor for inability to do that, either, if you ever want to be an effective programmer/troubleshooter. It's a skill that just takes lots of practice. You're on the right track.
Post back when you've made some more progress.
Cheers,
Dustin