Bruce
I'm just getting started with OpenPLC and and struggling to understand the behaviour of the trivial ladder code in the screenshot. The idea is that SW1 and SW2 reverse direction. When I start it in the debugger REV is immediatley high even though neither SW1 or SW2 have been activated. If I then force SW1 or SW2 everything comes right. It seems like I'm missing something fundemental in my initialisation. Any guidance would be appreciated.
Thanks, Bruce
 
Screenshot 2024-10-13 at 18.14.47.png
Reply 0 0
thiagoralves
Your first rung sets REV coil to true as it is an inverted coil and the rung evaluates to false initially. Consequently, if REV is true, it turns on the second rung on the very first scan cycle.
Reply 0 0
streatstyle
You can try something more like this either will work. One is an electrical push button interlock (the second one) which is what I think you were trying to do and the other is a mechanical interlock (the first one with the stop button).
Screenshot 2024-10-13 204733.jpg
Reply 0 0
Bruce
Thanks for the speedy response guys. I realize my mistake was to try to turn off something using an inverted coil rather than simply removing it's power. Onwards and upwards!
Reply 2 0
Reply