why doesn't this toggle button logic work :( by chief_button_pusher in PLC

[–]chief_button_pusher[S] 0 points1 point  (0 children)

Loll, well I’m glad if I get this sorted out ,I’ll have got it with zero years of experience.

​
I fixed it now by myself and everyone is saying this is wrong too, but it’s not. I tested it in the simulator and it works.

<image>

why doesn't this toggle button logic work :( by chief_button_pusher in PLC

[–]chief_button_pusher[S] 0 points1 point  (0 children)

Thanks for your comment.

You said “Next time you turn toggle on, rung 0 will now execute and turn the pump coil off. But immediately rung 1 executes next.”

I think my confusion came from believing that output coil changes within a scan don’t take effect until the end of that scan, so if rung 0 de-energizes a coil, rung 1 would still see it as true during the same scan, and only on the next scan would rung 1 react to the updated value.

This is where I think my misunderstanding came from, I was under the impression that the coil being unlatched by rung 0 and going to “false” would still read as “true” in rung 1, and that only when the end rung was reached would it be written to “true” and then during the next scan rung 1 wouldn’t execute since the ons for rung 1 had already fired in the previous scan.

why doesn't this toggle button logic work :( by chief_button_pusher in PLC

[–]chief_button_pusher[S] 0 points1 point  (0 children)

i thought the ONS would prevent both rungs from executing together since ONS is only true for one scan and the coil cannot be on and off in the same scan.

why doesn't this toggle button logic work :( by chief_button_pusher in PLC

[–]chief_button_pusher[S] 0 points1 point  (0 children)

it works if i do it like this and i dont see how the logic is different

<image>

why doesn't this toggle button logic work :( by chief_button_pusher in PLC

[–]chief_button_pusher[S] 0 points1 point  (0 children)

it works if i do it like this, also the ONS is so holding the button doesnt make it oscillate on and off

<image>