XIC — Examine If Closed

Description
Section titled “Description”XIC (Examine If Closed) tests a bit and allows logic continuity to pass downstream when the bit is 1 (true). Use it to gate logic based on a digital input—a switch, a button, a status flag, or an INT/DINT bit member. XIC is the foundation of all ladder logic; every rung’s power flow is shaped by XIC and XIO conditions. Do not use XIC to count events or store state; use data-file instructions (timers, counters, shift registers) for stateful behavior.
Operands
Section titled “Operands”| Operand | Type | Format | Valid Range | Required | Description |
|---|---|---|---|---|---|
| Address | BOOL or bit member | Tag name or Tag.bit |
Any declared BOOL tag or INT/DINT bit member | Yes | The tag or bit to examine. Continuity passes to the downstream rung when the bit is 1 (true). On hardware, an I/O pin defaults to INPUT_PULLUP (active-low) — read the REFERENCE for pin configuration. |
Scan Behavior
Section titled “Scan Behavior”Prescan
Section titled “Prescan”XIC has no persistent state. On the transition to run mode, XIC reads the bit and evaluates immediately.
Rung-condition-in is false
Section titled “Rung-condition-in is false”If the rung conditions to the left of XIC evaluate to false (no power flow), XIC does not evaluate. Downstream logic receives no power.
Rung-condition-in is true
Section titled “Rung-condition-in is true”XIC examines the bit value. If the bit is 1 (true), XIC conducts and continuity passes to the right. If the bit is 0 (false), XIC does not conduct and downstream logic receives no power.
Postscan
Section titled “Postscan”XIC has no state to update on the final scan. Transition out of run mode has no effect on XIC.
Example
Section titled “Example”Scenario: A start button wired to pin D2 (tag StartBtn, BOOL) should energize a motor output on pin D13 (tag MotorRun, BOOL).
Initial state:
StartBtn= 0 (button not pressed, no power flow)MotorRun= 0 (motor off)
Rung logic:
—|XIC StartBtn|———(OTE MotorRun)———Scan 1 — Button not pressed:
- Rung-in:
StartBtnis 0 - XIC result: Does not conduct (no continuity)
- Output:
MotorRun= 0 (motor stays off)

Scan 2 — User presses the button:
- Rung-in:
StartBtnbecomes 1 (input pulled low by the button, read as 1 by active-low logic) - XIC result: Conducts (continuity passes)
- Output:
MotorRunis energized to 1 (motor turns on)

Scan 3 — User releases the button:
- Rung-in:
StartBtnreturns to 0 (pull-up releases it) - XIC result: Does not conduct
- Output:
MotorRunde-energizes to 0 (motor stops)
The XIC condition controls continuity frame-by-frame. The motor runs only while the button is held pressed.
See Also
Section titled “See Also”- XIO — Examine If Open (inverted logic — passes continuity when the bit is 0)
- OTE — Output Energize (basic output coil — the most common downstream target)
- OTL / OTU — Output Latch / Output Unlatch (memory outputs that hold their state)
- Bit Logic Instructions — Category index
- Hardware Compatibility — Pin configuration, pull-up behavior, input wiring
Pull-up behavior: Input pins are configured as INPUT_PULLUP (active-low). A switch wired to GND pulls the pin to 0, which LadderIDE reads as 1 (true) in logic. A floating pin (not connected) reads as 0 (false) because the pull-up draws it to high. See Hardware Compatibility for wiring diagrams.
Bit members: XIC accepts INT and DINT bit members—for example, Flags.3 examines bit 3 of the tag Flags. The bit resolves at runtime; there is no separate tag for the member.
Applies to LadderIDE >=1.2.2 · Last reviewed 2026-09-08 · Screenshots verified 2026-09-08