Dernebo

Hello. I hope this is the right place to ask questions like this.

I am currently studying to be a production technician and one of the courses was about basic PLC programming and Ladder Logic. I would really appreciate if someone experienced could give me a hint on what is the problem.

Our task was to just create a running light, but I wanted to imitate the light-sequence of the traffic lights we have here in sweden instead.
Like this:

RED (6 seconds)
YELLOW (3 seconds)
GREEN (6 seconds)
GREEN and YELLOW (3 seconds)

And then repeat from RED again.

This is my program so far, just cycling through the three colours:
Skärmavbild 2021-02-02 kl. 23.12.12.png 
  So far so good. But when I try to activate the Yellow and the Green light together like this i doesnt work:

Skärmavbild 2021-02-02 kl. 23.18.42.png 
I have probably misunderstood something vital I guess. How can I add one more line that activates both GREEN and YELLOW before starting from the top again... I am using OpenPLC Runtime on Windows 10 and an Arduino Uno as slave.

Hoping for an answer about this...

/Fredrik, Sweden

Reply 0 0
thiagoralves
You never put coils in series. That is even an electrical mistake, like putting two lamps in series will give them the wrong voltage for each. You should put the coils in parallel instead ðŸ˜‰
Reply 0 0
Dernebo
You never put coils in series. That is even an electrical mistake, like putting two lamps in series will give them the wrong voltage for each. You should put the coils in parallel instead ÃƒÂ°Ã…¸Ëœâ€°


Hello and thanks for answering. 😉 I have tried that and it doesnt matter. The result is RED - ALL OFF - YELLOWGREEN and then loob back to red. Isnt it possible to reuse coils in later rungs?
It looks like it always is the last coil of the given colour that "wins"...


Last rung:
Skärmavbild 2021-02-03 kl. 06.59.21.png 

/Fredrik
Reply 0 0
Ngdayo
Yes only only one output per line and it is the last one on a line, is a good practices.
The last rung has a Green_LED switch controling a Green_LED coil, not good
Use only one coil per output, you can split it up and use a Set and Reset coil if you like to do them in two places
Reply 1 0
Dernebo
Ngdayo wrote:
Yes only only one output per line and it is the last one on a line, is a good practices.
The last rung has a Green_LED switch controling a Green_LED coil, not good
Use only one coil per output, you can split it up and use a Set and Reset coil if you like to do them in two places


Perfect. That was exactly what I was looking for. I have never used Set/Reset before and now it works great. Thankyou for your answer.  👍👍👍

/Fredrik
Reply 1 0
thiagoralves
Ladder logic is ciclic, which means all rungs are processed sequentially one after another. A common mistake is to believe that a "deactivated" or false rung is doing nothing. Instead, it is setting the output coil of that rung to false. So if you have a rung that activates a coil and then have another rung controlling the same coil below, the state of the coil will be defined by the last rung that controls it.
Reply 1 0
Reply