OTU — Output Unlatch

Description
Section titled “Description”OTU (Output Unlatch) clears a bit to 0 (false) and holds it cleared until an OTL (Output Latch) sets it again. Use OTU to release a latched output—typically on a separate rung gated by a stop or reset condition. OTU is stateful; the bit stays 0 after the rung goes false until OTL latches it back on. Do not use OTU to turn off an output that OTE controls; OTE already clears its bit when its rung is false. Always pair OTU with the OTL that sets the same bit.
Operands
Section titled “Operands”| Operand | Type | Format | Valid Range | Required | Description |
|---|---|---|---|---|---|
| Address | BOOL or bit member | Tag name or Tag.bit |
Any writable BOOL tag or INT/DINT bit member | Yes | The tag or bit to unlatch. When the rung is true, OTU clears this bit to 0 and holds it (the bit does not latch back when the rung becomes false). The bit remains cleared until OTL sets it again. |
Scan Behavior
Section titled “Scan Behavior”Prescan
Section titled “Prescan”OTU initializes the bit to its force value (or 0 if not forced). The unlatch state persists across rungs.
Rung-condition-in is false
Section titled “Rung-condition-in is false”If the rung conditions are false, OTU does nothing. The bit retains its previous state (latched or cleared). This mirrors OTL behavior: neither instruction acts on a false rung.
Rung-condition-in is true
Section titled “Rung-condition-in is true”If the rung conditions are true, OTU clears the bit to 0 and holds it cleared. On subsequent scans, even if the rung becomes false, the bit remains 0 until OTL latches it back on.
Postscan
Section titled “Postscan”The unlatch state is written to the output. The bit persists into the next scan at its cleared value.
Example
Section titled “Example”Scenario: (Same project as the OTL example.) A start button latches a motor on; a stop button on a separate rung unlatches it. All three tags are memory BOOLs so the example can be stepped in the simulator by toggling the two inputs.
Tags:
StartBtn— Start Button, BOOLStopPb— Stop Button, BOOLMotorRun— Motor run output, BOOL
Rung 1 (Start):
—|XIC StartBtn|———(OTL MotorRun)———Rung 2 (Stop):
—|XIC StopPb|———(OTU MotorRun)———Both coils act on the same bit, so both colour by that bit’s state: orange when it is latched, red while the OTU is actively holding it low, aqua when it is 0 and idle.
Scan 1 — Nothing pressed, motor off:
- Rung 1:
StartBtn= 0, OTL does nothing - Rung 2:
StopPb= 0, XIC does not conduct, OTU does nothing - Result:
MotorRun= 0, both coils aqua (idle)

Scan 2 — User presses the start button:
- Rung 1:
StartBtn= 1, XIC conducts (green), OTL setsMotorRun= 1 - Rung 2:
StopPb= 0, OTU does nothing - Result: Motor latched on; both coils turn orange

Scan 3 — User releases the start button:
- Rung 1:
StartBtn= 0, OTL does nothing - Rung 2:
StopPb= 0, OTU does nothing - Result: Motor remains on. The OTU coil is orange even though its own rung is off—it shows the state of the bit, which is still latched

Scan 4 — User presses the stop button:
- Rung 1:
StartBtn= 0, OTL does nothing - Rung 2:
StopPb= 1, XIC conducts (green), OTU clearsMotorRun= 0 - Result: Motor unlatched and off. Both coils turn red for as long as the stop rung is held true: the OTU is actively holding the bit low. Release the stop button and they return to aqua

See Also
Section titled “See Also”- OTL — Output Latch (sets and holds a bit; the complement to OTU)
- RES — Reset (also unlatches outputs and data-file state)
- OTE — Output Energize (non-latching, clears when rung is false)
- XIC — Examine If Closed (typical gate for OTU on a stop button)
- Bit Logic Instructions — Category index
Unlatch semantics: OTU is idempotent—clearing an already-unlatched bit to 0 is a no-op. The bit persists at 0 across scans independent of the rung condition (unlike OTE, which follows the rung every scan).
Latch/Unlatch pair: OTU is always paired with OTL on a different rung. Together they implement the classic start/stop logic: OTL on a start button, OTU on a stop button. The bit latches on and stays on until OTU releases it.
Coil colours: OTU and OTL colour by the bit they share, not by their own rung, so the pair always matches. Orange = the bit is set. Aqua = the bit is 0 and nothing is acting on it. Red = the bit is 0 because this OTU (or another on the same bit) is gated true right now. Red is the “held low” cue: if an output will not latch, look for the red OTU whose rung is stuck true.
Last one wins: If an OTL and an OTU on the same bit are both true in one scan, the one later in the scan order sets the final value. Put the stop rung after the start rung so that stop wins when both buttons are held.
RES interaction: An RES instruction on the same bit address as OTU will also clear the bit (and clear data-file state for timer/counter/control structures). See RES documentation for details.
Bit members: OTU accepts INT and DINT bit members—for example, Flags.3 unlatches bit 3 of the tag Flags. Both the bit and the base word are updated.
Applies to LadderIDE >=1.2.2 · Last reviewed 2026-09-09 · Screenshots verified 2026-09-09