interlink
I'm trying to simulate a traffic light in OpenPLC using SFC and I am using a start button to start the cycle of red light to yellow light to green light and back. The problem I think I am having now is that after the green light, it skips to the yellow light as the start button is set to true. Is there a way for me to set the value of the start button to false after the light turns green?
OpenPLC.png
Reply 0 0
thiagoralves
You’re having two states in one, that’s why it is not working. Your state zero (Step0) should be the init state, where you only test for the start button. The next state then should be the red light state, which is the state you return to from the green light.
Reply 1 0
thiagoralves
Also, instead of using timers as condition to move to the next state, you can simply use the implicit state time variable like “Step1.t > T#15s”. See   https://infosys.beckhoff.com/content/1033/tc3_plc_intro/2528361611.html?id=6355129952137514139 for more info
Reply 1 0
interlink
Also, instead of using timers as condition to move to the next state, you can simply use the implicit state time variable like “Step1.t > T#15s”. See   https://infosys.beckhoff.com/content/1033/tc3_plc_intro/2528361611.html?id=6355129952137514139 for more info
Thank you for the help! I will definitely look more into the documentation you have sent.
Reply 0 0
Reply