
WildFireDefenceSystems (Customer) asked a question.
Unexpected output behavior
Probably a rookie mistake but I don’t know why. Rung 1 sets an output, rung 4 resets that output and rung 6 sets the output again.
When running with rung 6 disabled DO 0.1.2.1 shows when DI 0.1.3.1 is turned on but…. When rung 6 is enabled DO 0.1.2.1 will not show when DI 0.1.3.1 is selected.
Ideas???
Hi @WildFireDefenceSystems (Customer)
The PLC operates on a cyclic scan. Logic is solved from left to right, top to bottom. The output/input status is available for the next rung in your ladder logic.
At the end of the scan, the outputs are all set and the inputs are read again.
Since you are trying to turn on and off the same output within the scan, the last rung is the only one that will be active.
https://accautomation.ca/who-else-wants-to-know-how-a-plc-scans/
You may find this post helpful:
https://accautomation.ca/productivity-1000-series-plc-program-control/
Regards,
Garry
ACC Automation
https://accautomation.ca/series/productivity-1000-plc/
To go along with Garry, you should only have one OUT instruction per physical output in your program. If required, SET/RST can be used if multiple conditions exist to trigger/reset an output.
Mapping your I/O can help visualize program flow better. I go cross-eyed looking at Psuite addresses.
As mentioned, only use one OUT per coil and/or physical output, and sparingly use SET/RST when necessary. This is not a case where it is IMO. SET/RST can get messy quick, especially when hunting through multiple tasks/routines attempting to find every one of them. Use branches and other control bits instead.
Here's a re-arranged version of what you have currently with Inputs mapped at the top, logic in the middle and outputs mapped at the end. I'd use more meaningful names than "InputX" etc, but those will be up to you.