BeginnerSet/Reset~8 min

Set / Reset

Latch and unlatch instructions (OTL / OTU) instead of a seal-in branch and the crucial detail of which one wins when both fire, decided purely by rung order.

Your goal

  • Pressing OnBtn latches the Lamp ON (stays on after release).
  • Pressing OffBtn unlatches the Lamp OFF.
  • If BOTH are pressed together, the Lamp must be OFF reset wins because its rung runs last.
Stuck? Show hints (3)
  1. Rung 1: NO OnBtn → OTL Lamp. Rung 2: NO OffBtn → OTU Lamp.
  2. OTL/OTU only act when their rung is TRUE otherwise they leave the tag alone. That's the whole difference from OTE.
  3. The scan runs top to bottom: whichever latch instruction executes LAST wins a conflict. Put the unlatch below the latch.

Pattern from Contact & Coil's classic ladder logic series.

I/O for this exercise

Inputs
OnBtnLamp on button
OffBtnLamp off button
Outputs
LampLamp
Loading the editor…