First, if you’re using a SLC500 then double check the Status numbers for Hour, Minute, and Second, my reference manual says those values are in S:40, S:41, and S:42
Second, read about the counter. The counter only increments when the rung transitions from false-to-true. So in Rung 0000 you do not need the if equal minute and if equal second.
Third, you should not need Rungs 0001 and 0002. Change the B3:10/0 in Rung 0003 to C5:8/DN and insert a rung before Rung 0000 that says If C5:8/DN then Reset C5:8. By placing the Reset before the counter this will allow you to use the Done bit for one scan.
Fourth, if your pumps are not run 24/7 then in Rung 0005 put something in there so the rung does not need to checked every scan.
Finally, your logic for selecting a different pump if a pump fails. I think what you want to try an say with your logic is - If this pump fails, then select the next pump.
What you are doing in your logic is saying, if this pump fails then I want to figure out which pump I can use and then run that pump. It’s over complicated. If you look at your logic you are saying the same thing in rungs 0004, 0005, and 0006.
Each rung says that if all three pumps fail then Disable Bus Washer. No need to say the same thing in three different rungs. Place this logic in a single rung. Plus you don’t want to use the same output more than once in your program, this will end up biting you. You could end up with one rung turning the output on while another rung turns it off.
Now take a look at where you are changing the Duty Pump Selector. Your logic is saying, if this pump fails, but not this pump then change the counter to this, or if not this pump but this pump then change the counter to that. It’s over complicated and you end up running the same logic more than once. I would simplify by saying, if this pump fails and the Duty Pump Selector is calling for this pump then change the Duty Pump Selector to the next pump, unless all three pumps fail in which case don’t change the Duty Pump Selector at all.
Try this –
If Pump 1 Fail and Pump 2 Fail and Pump 3 Fail then Disable Bus Washer.
If Pump 1 Fail and Rinse Pump 1 Selected and Not Disable Bus Washer then Move 1 to C5:9.ACC
If Pump 2 Fail and Rinse Pump 2 Selected and Not Disable Bus Washer then Move 2 to C5:9.ACC
If Pump 3 Fail and Rinse Pump 3 Selected and Not Disable Bus Washer then Move 0 to C5:9.ACC