FYI: the six rungs, four of which are conditional, of subroutine
0 Pre Start Check can be reduced to the five unconditional rungs below.
Now that you understand the scan cycle (and well done), you need to think about boolean logic.
This rung:
States, in prose:
IF the value of Y002 is 1, then ASSIGN 0 to the value of Y001.
There are only two possibilities:
- if Y001 has a value of 1 before this rung,
- then the expression evaluates to True,
- and 0 will be assigned to the value of Y001,
- so after this rung Y001 will have a value of 0
- if Y001 has a value of 0 before this rung,
- then the expression evaluates to True,
- and there will be no assignment to the value of Y001,
- but the value of Y001 was already 0,
- so after this rung Y001 will have a value of 0
So no matter what the value of Y001 is
before this rung, the value of Y001 will
always be 0
after this rung.
Which means the presence of the if expression has no effect on the final result, so the [if <expression>] can be removed from the prose version of this logic, and the NO Contact can be remove from the rung version of this logic.
The same logic holds for Y002. And since original rungs 3 and 4 will always assign values of 0 to Y001 and to Y002, original rung 2 is unnecessary as well.
And since Y001 and Y002 will always both have values of 0 after original rung 4, the conditional NO Contacts on original rung 5 will always evaluate to True, so those NO Contacts can be removed as well.