In the downloads section of this website, under Allen-Bradley, there is a document with a name summat like "Alternators.PDF" that has many ways to skin the cat named "toggle bit."
My personal favorite is the XOR, because it combines the canonical and easily recognized Start/Stop Circuit and State Coil/Fault Coil patterns; it has a correct version of the approach you were attempting. I find latch/unlatch to be an anti-pattern here, but you could choose the one that makes the most sense to you.
Also, I assume at some point you have XIO GX_LUBE_PUMP1_LEAD OTE GX_LUBE_PUMP2_LEAD after the code above; note that you could have muted the XIC one-shot bit with XIO GX_LUBE_PUMP2_LEAD on that last rung.
I'm gonna sure check it on Monday.
Yes, I removed everything for the test, when Pump 1 is lead, Pump 2 is lag and backward, all used in logic to start the correct lead pump, and lag if needed.
It's the first one I did (I'll have at least another scheme like that later), but what I'm doing is logic to ultimately latch (needs to be latched) an AC pump output ON (from SFC Logic) later on using Set / Reset logic, with priority over the set or the reset depending of the needs. I figured out (Schneider has SR and RS blocks so it's usually a no-brainer for me) that to prioritize one over the other I need to either place the (U) or the (L) last. So right now it's working as intended, but if I can make it a notch better or easier that would be great.
On this particular logic, which are pumps for bearing cooling, which is critical that we always have one pump running, I also have a backup DC pump on the inverter that is fed from a 125DC battery bank in case we lose the 125kV line going in the station (and then the 600VAC station service MCC). What is messed up and I never saw before is that the "start" output is always on, and I need to pulse it to "0" in order to start the pump. It's like a kind of weird fail safe I never saw before. All of my 125/24DC control is already from the battery bank anyway, so it would start the pump mostly only on a 24DC PLC output relay fail, and I'll probably trip the unit on an over pressure right after that since that pump is too powerful. And then I have a stop output on that pump too, no DWG, so I don't know who wins when both commands are "ON" at the same time. Anyway I'll be already tripped and stopping by then, but it's weird.
I'm thinking out loud, sorry.
Sorry for the bad English too, still french.
Have a good weekend guys,.