ladder·IEC 61131-3·industrial·complexity 3/3
System mode selection (Set/Reset)
ladder·§ IEC 61131-3
↘ preview
100%
UTF-8 · LF · 25 lines · 890 chars✓ parsed·5.3 ms·11.9 KB SVG
Scenario
An Allen-Bradley PLC program for a machine that requires mutually exclusive Auto and Manual operating modes, with a Home command that can trigger a manual mode entry as a safety fallback. The latched Set/Reset coil pattern is standard for retained-state mode selection that survives a power cycle.
Annotation key
OTL(tag, addr, name=...)— Output Latch (Set): energizes and latches the bit high; bit stays high even when the rung loses powerOTU(tag, addr, name=...)— Output Unlatch (Reset): clears a latched bit back to 0parallel: branch:— output-side parallel branches execute simultaneously when the rung is true- Rung 1 sets Auto and simultaneously resets Manual; Rung 2 does the inverse
- The
SYS_FAULTXIO contact appears in both rungs as a master interlock — no mode change is allowed during a fault
How to read
Rung 1 fires when the operator presses the Auto HMI button AND Manual is not pressed AND no fault exists. It simultaneously latches SYS_AUTO ON and unlatches SYS_MANUAL. Rung 2 is the mirror: Manual button OR Home command, guarded by Auto-not-pressed and no-fault, sets Manual and resets Auto. The latched coils mean the last-pressed mode persists through PLC power cycles.