Alternating pumps

OSF catches the end of each demand. A toggle rung flips LeadB, and LeadB picks the pump for the next demand.

Step by step

Pick a step. The rungs are drawn by the editor after Core scans the program up to that step.

1. Demand on. LeadB is 0, so PumpA runs.

StepDemandSwapLeadBPumpAPumpB
1. Demand on10010
2. Demand off01100
3. Scan 300100
4. Demand on10101
5. Demand off01000
6. Demand on10010

Why it works

  • OSF passes power for one scan when Demand turns off, so Swap is on for exactly one scan per cycle.
  • The toggle rung writes LeadB from two branches: Swap on and LeadB off, or Swap off and LeadB on. With Swap off it keeps LeadB as it is. With Swap on it flips it.
  • PumpA runs while LeadB is 0 and PumpB while it is 1.

Common mistakes

  • Toggling without a one-shotIf Swap stays on, LeadB flips every scan and the pump choice is random.
  • Swapping while a pump runsSwap on the end of demand, as here, so a running pump is never switched over.

Instructions used

Related