The final step is where we add the operator's manual stop override, which is only to be effective when the measured level is between the low (240) and high (800) level limits. Furthermore, we can also assume the stop override is only effective when the motor is running: if the motor is already stopped, then we do not care if the operator wants it to stop.
For those conditions, the logic will look like this image
where the green-highlighted paths indicate True conditions; every other path is False*. Note that the output rung of the [Is Level>800?] instruction is False, as are those of the [select this pump] and [start selected pump] instructions, while both input and output rungs of the [Is Level>240] instruction are True; all of that together tells us that the level is beween the trigger limits, and the seal-in [Is Y2D5=1?] instruction branch is what is keeping the pump running.
Looking at that, it should be obvious that the place where the operator's manual stop override stop event can most easily stop the pump is to change seal-in branch to False. Also, because it is a seal-in branch, once Y2D5 is assigned a 0 on the output for even just one scan, the seal-in will be disabled for subsequent scans, and the pump will not re-start until one of the Start conditions becomes True again. Simply put, that seal-in branch need to change from
to
- BOTH [Is Y2D5=1?]
- AND [NOT STOP]
So when [STOP] become s True, then
AND [NOT STOP] will become
AND False, and the rung will be disabled. Note however, that the STOP condition is dependent on two bits: SELECT_THIS_PUMP and STOP_SELECTED_PUMP; for STOP to be TRUE, those will both be 1, similar to the [Is SELECT_THIS_PUMP=1?] AND [Is START_SELECTED_PUMP=1] branch logic of the start override above the seal-in. So we have
- STOP = SELECT_THIS_PUMP AND STOP_SELECTED_PUMP
but we need to evaluate [
NOT STOP]. To do this, we use
De Morgan's Laws, which tell us that, if A = B AND C, then NOT A = (NOT B) OR (NOT C), i.e.
- NOT STOP = (NOT SELECT_THIS_PUMP) OR (NOT STOP_SELECTED_PUMP)
Coding that into ladder yields this:
Again, the HMI interaction is based on "Set and Forget," where the stop override bit will only become a 1 if the HMI writes a 1, and the PLC will always clear that bit to 0.
De Morgan and other formalisms aside, it should be clear that, when the pump is being maintained by the seal-in only, i.e. [Is Y2D5=1] is True and [Is Level>800] is False, then as long as
- EITHER this pump is NOT selected,
- OR the stop override button is NOT pressed,
then the pump should be allowed to run, and inversely if the stop override is pressed while this pump is selected, those ORed instructions will disable the seal-in and stop the pump.
* I specifically do not say "the logic flows ..." because, as @Ron Beaufort points out in his boot camp video, those semantics lead to problems.