what I have done
I set up a normal motor run circuit for each of the pumps, just as if they were both always running simultaneously. This circuit of course has all of the faults that will inhibit the pump from running, and of course the auto input. Where I work, the jog circuit is almost always hardwired and is not done from the PLC.
Next, I set up a Flip Flop circuit to flip a bit back and forth. You can drive this flip flop with whatever you want, in order to switch the pump priorities. The bit from the Flip flop will determine which pump is the standby (lag) or main (lead) pump. I call this bit the Pump is Lead bit. This means that when the bit is on, pump A is the main, and B is the standby. When the bit is off, pump B is the main, and A is standby. I switch lead and lag pumps when either both pumps are running or both pumps are stopped. You can switch the lead and lag pump run commands based off of run hours if you want.
Next I determine how many pumps I want to run. 0, 1, or 2 pumps. For my application, I determine how many pumps I want to run based off the level of the tank that the pumps are pumping liquid from. The level of the tank turns on a bit that says run lead. When the level goes higher, it turns on a bit that says run lag. If both bits are on then two pumps run, if only the run lead pump bit is on, then only 1 pump (the main pump) runs. And of course, if no bits are on, then neither pump runs.
Logic that is placed in front of the Pump run logic for pump A
Run Pump A Pmp A Etc. Run
Lead is Lead Fault Pmp A
--| | |-----| | --------------|/|-------| |----------( )
| |
| Run Pump A |
| Lag is Lead |
--| | |-----|/|----------
Run Pump A Pmp A Etc. Run
Lead is Lead Fault Pmp B
--| | |-----|/| --------------|/|-------| |----------( )
| |
| Run Pump A |
| Lag is Lead |
--| | |-----| |----------
What this says is ..... If you are calling for the lead pump to run
and pump a is the lead/main pump, then run A. If you are calling for
the lag/standby pump to run, and A is the standby, then run A.
It says the same for B. ie. if b is lead and calling for lead, then run b etc.
I hope this helps get you started in your thinking. It is almost 9:00pm on a Friday night, and I am tired of working. I also had some logic to Run the Lag pump in case the lead pump failed to run, but I don't remember what it looks like. I think I just added another branch on both pumps and said that if the lead pump failed to run and this pump is the lag, then run or something.
Let me know if you want some more advice. I really shouldn't get on here under the influence of alcohol.