Book a consultation

PLC Programming

XIC Instruction (Examine If Closed): What It Really Tests in a PLC

The XIC instruction asks one question: is this bit 1 right now? How it works, normally closed stops, XIC vs XIO, 26 vendor editors, and a quiz.

Vladimir Romanov ·


Table of contents14 sections

Every ladder program you will ever open is full of normally open contacts, which Rockwell Automation software calls XIC instructions, and most of the confusion about them comes from the name. “Examine If Closed” sounds like the controller is looking at a switch. It isn’t. The XIC instruction asks one question, about one bit in memory, at one moment in the scan: is this bit 1 right now? Get that sentence right and normally closed stop buttons, XIC versus XIO, and “why is my rung green but my output off” all stop being mysteries.

I’ve written this as the reference I wish I’d had earlier in my career, when I was programming controllers myself. It starts from zero, with a push button and a light, and works up to scan timing, prescan, status words from other machines, and how the major vendors write the same instruction. At the end there is an interview-style quiz and five harder problems with worked solutions. The animations show each idea moving, and every one of them has a pause control.

The short version. XIC tests one bit: it is true when the bit is 1 and false when the bit is 0. It does not know or care how the field device is wired. Choose XIC or XIO by asking one question: when this rung should pass, is the bit 1 or 0?

What is the XIC instruction?

The XIC instruction, short for Examine If Closed, is a ladder logic input instruction that checks one bit. If the rung reaching it is true and the bit is 1, XIC passes power to the next instruction. If the bit is 0, it blocks power. Rockwell Automation calls it XIC; most other vendors call the same symbol a normally open contact.

Ladder diagrams describe the result as power flow, a habit inherited from relay panels. Rockwell’s own term is rung condition: each instruction receives a true or false rung condition from its left and passes one to its right. This guide uses both, and means the same thing.

Here is the smallest useful program: one push button, one XIC, one output coil (OTE) and one pilot light.

Animation of a push button, a ladder rung with an XIC on Start_PB driving an OTE coil on Pilot_Light, and a lamp turning on and off as the button is pressed and released.
Press the button and the input bit becomes 1, the XIC turns true, power reaches the OTE coil and the light comes on. Release it and everything reverses. Download the GIF

Rockwell’s Logix 5000 general instructions reference manual (publication 1756-RM003) defines XIC with a single operand, a BOOL data bit, and a short execution table. That table is the whole instruction, so it is worth reading once:

Condition when the XIC executesRung condition passed to the right
Rung condition coming in is falseFalse
Rung condition coming in is true, bit is 0False
Rung condition coming in is true, bit is 1True
Prescan (when the controller enters Run mode)False
PostscanFalse

Source: Rockwell Automation, Logix 5000 Controllers General Instructions Reference Manual, 1756-RM003, XIC section.

The same manual lists XIC as a relay ladder instruction, says it does not touch the arithmetic status flags, and gives it no fault conditions. There is no XIC in Structured Text. You write the bit into an expression instead, for example IF Start_PB THEN.

Why is it called “Examine If Closed”?

The name comes from relay logic, the hard-wired control panels ladder diagrams were invented to replace. In a relay panel a contact really was a piece of metal that was either closed or open, and a rung really did conduct when the contacts in series were closed. Early PLCs kept the drawings so electricians could read them, and kept the vocabulary with them.

The vocabulary outlived the hardware. In a modern controller there is no contact to examine. “Closed” in the name means “the bit is 1”, and “open” in XIO, Examine If Open, means “the bit is 0”. The trouble starts when people read “closed” as a description of the switch in the field. I think most of the wrong answers about XIC online come from that one slip, so this guide uses “the bit is 1” everywhere and leaves “closed” for actual hardware.

What does the XIC instruction actually read?

In normal use XIC reads a bit in controller memory, not a terminal. For a physical input, that bit is a copy of the terminal state that the I/O system put there earlier. The same kind of bit can also be written by another rung, a timer, another controller or an HMI, or overridden by a force, and XIC cannot tell which of them set it.

Where the bit an XIC reads comes fromA diagram. On the main path, a field device puts 24 volts on an input terminal, the input module sends its state to the controller at the requested packet interval, the controller writes it to an input tag such as Local:1:I.Data.0, an alias such as Start_PB points at that tag, and the XIC reads the alias. Below, five other things can also set the same kind of bit: an output instruction elsewhere in the program, a timer or counter status bit, a tag produced by another controller, a write from an HMI, and a force applied from the programming software. XIC cannot tell these sources apart; it only reads whether the bit is 1.THE MAIN PATH: A FIELD INPUTField devicepush button, sensorInput module24 V DC input pointInput tagLocal:1:I.Data.0Alias tagStart_PBXICis the bit 1?updated at the RPI or on change of state,not when the XIC runs (Logix)OTHER THINGS THAT CAN SET A BIT XIC READSAnother rungOTE / OTL writes itTimer or counterConveyor_TON.DNAnother controllerproduced / consumed tagAn HMI or SCADAwrites a pushbutton tagA forceoverrides the inputXIC cannot tell these sources apart.When an XIC is not doing what you expect, find which of these last wrote the bit.
The bit an XIC reads can come from a field input or from five other places. When an XIC misbehaves, the first job is to find out which one wrote the bit.

The main path, for a push button on a 24 V DC input card, looks like this:

  1. The button closes and puts 24 V on an input terminal.
  2. The input module turns that voltage into a 1 for that point.
  3. The module sends its data to the controller, which writes it to an input tag. In Studio 5000 Logix Designer a point on a 1756 discrete input module in the local chassis looks like Local:1:I.Data.0.
  4. Most programs then give that point a readable name with an alias tag, such as Start_PB.
  5. The XIC reads the alias.
Control panel terminal blocks with numbered wire markers and two glowing orange LED status indicators
Every XIC on a field input starts here: a wire on a terminal. The program only ever sees the bit the I/O system made from it.

The operand does not have to be an input. Rockwell’s SLC 500 instruction set reference manual (1747-RM001) gives three XIC examples side by side: a push button on an input (I:0/4), an output wired to a pilot light (O:0/2), and a timer’s done bit (T4:3/DN). Those are the manual’s own addresses; in a modular SLC 500 the processor sits in slot 0, so real I/O starts at slot 1. In Logix the same idea covers any BOOL: an internal bit, a member of a user-defined type such as Pump101.Running, a timer’s .DN bit, a bit inside a DINT written as Filler_Status.4, or an element of a BOOL array.

That flexibility is the reason the bit-first rule matters. When an XIC on Pump101.Running is true, nothing in the instruction tells you whether the pump is running. It tells you that something set that bit to 1.

Is XIC normally open or normally closed?

XIC is drawn like a normally open contact, and it passes power when its bit is 1. It does not describe the field device. A normally closed device that is not actuated puts voltage on its input, so its bit is 1 and an XIC on it is true. That is the normal way to program a stop button.

This is the single most asked question about XIC, so it gets its own animation.

Animation of a normally closed stop button wired to an input, an XIC on Stop_PB and an OTE on Run_Permit; pressing the button and then a broken wire both drop the bit to 0.
A normally closed stop button holds its input bit at 1, so the XIC is true and the run permit is on. Pressing Stop or breaking the wire drops the bit to 0, and the same XIC goes false. Download the GIF

Stops are wired normally closed for a practical reason. If the wire breaks, a terminal backs out or the input loses power, the bit drops to 0 and the machine stops. A normally open stop wired to an XIO would do the opposite: a broken wire would look exactly like “nobody is pressing Stop”, and the machine would keep running with a dead stop button. Treat that as engineering practice that applies to any stop or permissive signal. It covers one kind of failure, an open circuit. A wire shorted to 24 V, a welded contact or a stuck input channel still reads 1, which is one reason an emergency stop is never just a PLC input: it belongs to a safety relay or safety controller with its own diagnostics.

So the rule I use, and teach, is to pick the instruction from the value the bit has when the rung should pass:

Field device and wiringBit when the rung should passInstruction
Start button, normally open1 only while pressedXIC
Stop button, normally closed1 while not pressedXIC
Air pressure switch, closed when pressure is above setpoint1 while pressure is OKXIC
Motor overload contact, normally closed1 while healthyXIC to run, XIO to raise the trip alarm
Photo-eye, output on when it sees a part1 while a part is presentXIC for “part here”, XIO for “lane clear”
Low-level float, made when the level is above it1 while there is liquidXIC as a pump permissive

Notice that the instruction column is almost all XIC, even though the devices are a mix of normally open and normally closed. That is the point. XIO appears where the rung should pass on a 0: a fault bit that is 0 when healthy, a “lane clear” check, or an alarm on a lost signal.

The photo-eye row hides a trap worth naming. An XIO for “lane clear” also passes when the sensor dies or its wire breaks, because a dead sensor reads 0 too. Where a false “clear” could cause a collision, choose a sensor mode where failure reads as blocked, or add a sensor diagnostic.

One honest caveat. A standard input card cannot tell a broken wire from a pressed normally closed button; both read 0. Some diagnostic input modules can detect an open wire on each point. On an ordinary card, the wiring choice is what turns an open circuit into a stop, not the logic.

XIC vs XIO: what is the difference?

XIC and XIO test the same bit and give opposite answers to that test. XIC, Examine If Closed, is true when the bit is 1. XIO, Examine If Open, is true when the bit is 0. If the rung coming into either one is false, both pass false. Neither changes the bit. Use XIO when the rung should pass because something is absent, off or not faulted.

Animation of two rungs reading the same bit Part_Present: the XIC rung closes a clamp and the XIO rung requests a part, and the two show opposite states as the bit changes.
One bit, two rungs. When Part_Present goes to 1 the XIC rung turns true and the XIO rung turns false, and they swap back when the part leaves. Download the GIF
XIC (Examine If Closed)XIO (Examine If Open)
True when the bit is10
SymbolTwo barsTwo bars with a slash
Other vendors’ nameNormally open contactNormally closed contact
Structured text equivalentIF Bit THENIF NOT Bit THEN
Typical usePermissives, running and ready signals, normally closed stopsFault-free conditions, “lane clear”, alarms on lost signals
Changes the bitNoNo

Remember the bit, not the switch.

How do XIC instructions combine? Series is AND, parallel is OR

Two XICs in series pass power only if both bits are 1, which is a logical AND. Two XICs on parallel branches pass power if either bit is 1, which is a logical OR. Almost every permissive chain and every “start from here or from there” rung in a plant is built from these two shapes.

Animation of a series rung with XIC Guard_Closed and XIC Auto_Mode, a parallel rung with XIC Local_Start and XIC Remote_Start, and a truth table filling in four rows.
The truth table fills in as both bits cycle through every combination. The series rung only passes with both at 1; the parallel rung passes with either. Download the GIF
ABSeries rung: A AND BParallel rung: A OR B
0000
1001
0101
1111

In the animation, A is Guard_Closed on the series rung and Local_Start on the parallel rung; B is Auto_Mode and Remote_Start.

Two things follow from this. First, for plain XIC and XIO instructions on bits that do not change mid-scan, the order in a series chain does not change the answer, so put them in the order a technician would check them, with the most likely blocker first. Second, an XIC is not limited to the left side of a rung. It can sit anywhere an input instruction is allowed, including inside a branch after other instructions.

When does an XIC look at its bit? The scan, prescan and asynchronous I/O

An XIC reads its bit at the moment the controller executes that instruction, each time its routine runs (normally once per scan). What value it finds depends on when the bit was last written. In a classic scan, inputs are copied into memory at the start and do not change until the next scan. In a Logix controller, input data arrives on its own schedule and can change mid-scan.

Animation of a three-step scan cycle beside two rungs, showing a button pressed mid-scan that the XIC only sees on the next scan.
A classic scan reads inputs, solves the rungs top to bottom, then writes outputs. A press that happens mid-scan is only seen on the next scan, while a bit written by one rung is seen at once by the rungs below it. Download the GIF

Process image controllers: one snapshot per scan

Siemens documents this model for the S7-1500 in its cycle and response times function manual: at the start of each cycle the CPU reads the input modules into the process image of the inputs, then runs the user program, then writes the process image of the outputs to the output modules. Every XIC on an input read through the process image sees the same snapshot for the whole scan. (Siemens also allows direct peripheral reads, written with a :P suffix, which bypass the image; ordinary logic rarely needs them.) The SLC 500 works the same way, with an input scan before the program scan.

The animation shows the consequence. A button pressed halfway through a scan is invisible until the next one, which at typical scan times of a few to a few tens of milliseconds nobody notices. Internal bits are different: when rung 0 writes Pilot_Light, an XIC on Pilot_Light in rung 1 sees the new value in the same scan, because it is reading memory the program just changed. A rung above the writer sees it one scan later, which is exactly why a seal-in contact turns true on the scan after its coil.

Logix controllers: inputs update on their own schedule

ControlLogix and CompactLogix controllers do not take one snapshot per scan. Rockwell’s ControlLogix 5590 user manual describes I/O data as refreshed asynchronously to logic execution: each module sends its data at its requested packet interval (RPI), or sooner on a change of state where the module is configured for it, and the input tags change whenever that data arrives. Outputs go to the modules on the same asynchronous basis. An input tag can therefore change between two rungs that read it in the same scan.

Most of the time that does no harm. It bites when two rungs must agree. If rung 10 starts a sequence step on Part_Present and rung 40 latches the step’s data on the same tag, the two can see different values in one scan. The usual fix is to buffer: copy the input words you care about into internal tags once, at the start of the task, with a synchronous copy (CPS) or a single move of the whole word so a higher-priority task cannot interrupt it halfway, and have every XIC read the copies. I treat buffering as a design decision for each program, not a rule for every input. High-speed or event-driven signals often belong in their own handling instead.

Prescan and level, not edge

Two more behaviours come straight from the execution table. During prescan, when the controller goes into Run, XIC passes false regardless of its bit. Output coils (OTE) on those rungs are cleared for that pass; latched bits (OTL) keep their values. And XIC is level-sensitive: it is true on every scan while the bit is 1. If you want something to happen once when a button is pressed, XIC alone will do it on every scan the button is held. That is the job of a one-shot instruction (ONS) or a transition-sensing contact, which gets its own post in this series.

XIC in practice: eight scenarios from simple to advanced

These scenarios run from the first rung most people learn to patterns I’d expect to see in a well-built plant program. Each one shows the rung in a particular state, why XIC is the right instruction there, and what tends to go wrong. Tag names are examples, written the way I’d want them in a real program.

1. Material handling: start and stop with a seal-in

The classic motor circuit, the PLC version of three-wire control. Start is a normally open button, Stop is normally closed, and the coil’s own bit holds the rung in after Start is released. Every instruction on the rung is an XIC. The overload and other permissives are left out to keep the rung readable; a real one has them in series with Stop.

Animation of a seal-in rung with XIC Stop_PB in series with a branch of XIC Start_PB and XIC Motor_Run, driving the OTE Motor_Run and a conveyor motor.
Start energizes the coil; on the next scan the XIC on Motor_Run seals the rung in; Stop drops it out, and it stays off until Start is pressed again. Download the GIF

Why XIC: each bit is 1 in the state that should let the motor run: Stop at rest, Start while pressed, and the motor’s own run bit once it is on. What goes wrong: a stop button wired normally open and programmed as XIO, which keeps running after a broken wire. And note what this rung seals on: its own coil bit, which is a command, not proof the motor is running. Where the starter has an auxiliary contact, many programs seal on that feedback instead, so a tripped starter breaks the seal.

2. Packaging: a labeler fires only when four conditions agree

A label applicator should only fire when the conveyor is running, a product is at the photo-eye, the labeler reports ready, and there is no labeler fault.

Packaging: a labeler fires only when four conditions agreeOne rung. Four instructions in series feed the coil Label_Request: XIC Conveyor_Running, XIC Product_At_Eye, XIC Labeler_Ready and XIO Labeler_Fault. In the state shown all four are true, so Label_Request is energized.Conveyor_RunningXIC= 1Product_At_EyeXIC= 1Labeler_ReadyXIC= 1Labeler_FaultXIO= 0Label_RequestOTE12
Four conditions in series. Three are XIC because the healthy state is 1; the fault check is XIO because the healthy state of a fault bit is 0.

Why XIC: Conveyor_Running, Product_At_Eye and Labeler_Ready are all 1 in the state where the labeler should fire. Labeler_Fault is 0 when healthy, so it takes an XIO. What goes wrong: because XIC is level-sensitive, this rung holds Label_Request at 1 for as long as the product sits at the eye. If the labeler acts on the level rather than an edge, one product can get two labels. In a real program the request goes through a one-shot or the labeler’s own handshake.

3. Water and wastewater: pump down between two float switches

A lift station pump should start when the level reaches the high float and keep running until the level falls below the low float. That is the seal-in pattern again, with floats instead of buttons.

Water and wastewater: pump down between two float switchesOne rung with a branch. XIC Low_Float is in series with a parallel branch of XIC High_Float and XIC Pump_Run, feeding the coil Pump_Run. In the state shown the level is between the floats, the low float is made, the high float has cleared, and the pump keeps running through its own seal-in branch until the low float drops out.Low_FloatXIC= 1High_FloatXIC= 0Pump_RunXIC= 1Pump_RunOTE4
The pump started at the high float and is now holding itself in through its own run bit, so it keeps pumping between the floats until the low float drops out.

Why XIC: the low float is made, so its bit is 1, while there is liquid above it, which is exactly when the pump may run. The high float only needs to start the pump; the Pump_Run branch holds it. What goes wrong: without the seal-in branch the pump starts and stops on every ripple at the high float. If a float’s wiring fails open, this rung stops the pump, which is safe for the pump but not for the wet well, so real stations add a separate high-high alarm and often a backup float circuit outside the PLC.

4. Chemicals and brewing: a high level switch raises an alarm and stops the fill

A batch tank fills through an automatic inlet valve. A high level switch, LSH-101, sits near the top of the tank and closes when the liquid reaches it. One bit does two jobs on two rungs: an XIC on it raises the alarm, and an XIO on the same bit takes the permit away from the inlet valve.

Animation of a batch tank filling through an inlet valve until a high level switch closes; a rung with XIC LSH_101 turns on an alarm beacon, and a fill rung with XIC Fill_Request and XIO LSH_101 closes the inlet valve.
The tank fills until the liquid reaches LSH-101. Its bit goes to 1, the XIC on rung 0 turns the alarm on, and the XIO on the same bit in rung 1 drops the inlet valve, so filling stops. Download the GIF

Why XIC: the alarm should be on exactly when the switch bit is 1, and that is the question XIC asks. What goes wrong: three things. First, the wiring. Many plants wire level switches fail-safe, so the contact is closed while the level is normal and opens on a high level or a broken wire. Then the bit is 1 when all is well, and the alarm rung needs an XIO, which is this post’s main rule again: read the loop drawing before you choose. Second, chatter. Liquid sloshing at the switch makes and breaks it, so the alarm flickers and the valve cycles. Latch the alarm until an operator acknowledges it, and do not restart the fill on the switch alone: wait for a drain-down delay or a lower level reading, from a second switch or a level transmitter, and a fresh fill request. Third, layers. This switch and these rungs are ordinary process control. Protection against an overflow that could hurt someone or the environment belongs to an independent high-high switch with its own trip, designed as a safety instrumented function to IEC 61511, the process-industry safety standard, where the hazard calls for one, never to the same switch and the same rung.

5. Food and beverage: a CIP supply pump starts only on a proven route

In a clean-in-place system the supply pump should only run when the program is in the supply step and the valves for one valid route have proven their positions with their own feedback switches.

Food and beverage: a CIP supply pump starts only on a proven routeOne rung. XIC CIP_Step_Supply is in series with a parallel branch, where the top path is XIC V101_Open_Prf and XIC V102_Closed_Prf (route A) and the lower path is XIC V103_Open_Prf and XIC V104_Closed_Prf (route B), feeding the coil P201_Run_Permit. In the state shown route B is proven, so the permit is on.CIP_Step_SupplyXIC= 1V101_Open_PrfXIC= 0V102_Closed_PrfXIC= 1V103_Open_PrfXIC= 1V104_Closed_PrfXIC= 1P201_Run_PermitOTE31
Two valid routes in parallel, each a pair of valve-position proofs in series. Route B is proven in the state shown, so the pump permit is on even though route A is not.

Why XIC: each proof bit is 1 when the valve has reached the commanded position, which is the condition the pump needs. Series XICs make “both valves of this route”, parallel branches make “this route or that one”. What goes wrong: reading the valve’s command bit instead of its proof switch. An XIC on the command tells you what the program asked for, not where the valve is, and that difference is exactly what a route proof exists to catch.

6. Pharmaceutical: a cleanroom airlock never opens both doors at once

An airlock between two cleanroom grades has two doors, and only one may be open at a time so air never flows straight through. Each door’s release rung needs the other door proven closed.

Pharmaceutical: a cleanroom airlock never opens both doors at onceTwo rungs. Rung 3: XIC Door_B_Closed and XIC Open_A_Request in series feed Door_A_Release. Rung 4: XIC Door_A_Closed and XIC Open_B_Request in series feed Door_B_Release. In the state shown door B is open, so Door_B_Closed is 0; an operator is requesting door A, but rung 3 stays false and door A stays locked until door B is closed.Door_B_ClosedXIC= 0Open_A_RequestXIC= 1Door_A_ReleaseOTE3Door_A_ClosedXIC= 1Open_B_RequestXIC= 0Door_B_ReleaseOTE4
Each door can only be released while the other is proven closed. Door B is open in the state shown, so the request to open door A is ignored and door A stays locked.

Why XIC: Door_B_Closed is 1 only while door B’s position switch proves it is shut, which is exactly the condition door A needs before its lock may be released. What goes wrong: two things. Reading the lock command instead of the door position switch is the same command-versus-proof trap as the CIP route; door position stays the proof. And as drawn, if both doors are closed and both requests arrive in the same scan, both rungs are true and both doors are released together. The usual fix is a cross-interlock: add an XIO on Door_B_Release to rung 3 and an XIO on Door_A_Release to rung 4, so whichever rung is solved first wins: here door A, because rung 3 runs before rung 4. The cross-interlock reads the other door’s release command only to break a tie inside one scan. This is the program-side interlock; the door hardware usually has its own, and an emergency release must never depend on this logic.

7. Bottling: one bit of a status word from an OEM filler

Machines from other builders usually report their state as a status word over the network, and their interface specification says what each bit means. XIC can read a single bit inside a DINT directly.

Bottling: reading one bit of a status word from an OEM fillerTwo rungs. Rung 7: XIC Filler_Status.4 and XIC Capper_Status.4 in series feed Line_Ready. Rung 8: XIC Filler_Status.9 feeds Filler_Starved_Alm. The status words are DINT tags received over the network from the machine builders; the bit numbers come from the builder's interface specification. In the state shown both machines report ready and the filler is not starved.Filler_Status.4XIC= 1Capper_Status.4XIC= 1Line_ReadyOTE7Filler_Status.9XIC= 0Filler_Starved_AlmOTE8
XIC reading individual bits of DINT status words received from the filler and the capper. The bit numbers come from each builder's interface specification, not from the PLC.

Why XIC: Filler_Status.4 is the filler’s own “ready” bit; writing .4 reads bit 4 of that DINT without copying it anywhere. What goes wrong: bit numbering that starts at 1 in the builder’s document while Logix starts at 0, byte and word order on the network, and bit numbers that drift between machine software versions (keep the builder’s interface document under the same change control as the program, and if a builder will not share it, the options are the same as for a PLC program the OEM won’t hand over), and status words that stop updating when the connection drops while still holding their last value. A rung like this should sit behind a communication-health check, usually a heartbeat bit the other machine toggles and this controller watches with a timer.

8. Assembly cell: standard logic reads the safety system, it does not perform it

A robot cell will not start unless the safety relay is healthy, the gate is closed and the robot is home. The XIC on Safety_Relay_OK is the one people misunderstand.

Assembly cell: standard logic reads the safety system, it does not perform itOne rung. XIC Safety_Relay_OK, XIC Cell_Gate_Closed and XIC Robot_Home in series feed the coil Cycle_Start_Allowed. In the state shown the gate is closed and the safety relay reports healthy, but the robot is not home, so the cycle is not allowed. Safety_Relay_OK is a status signal from the safety relay, which performs the safety function on its own; the standard PLC only uses the status to sequence the cell and to tell the operator why it will not start.Safety_Relay_OKXIC= 1Cell_Gate_ClosedXIC= 1Robot_HomeXIC= 0Cycle_Start_AllowedOTE2
The gate is closed and the safety relay is healthy, but the cell will not start because the robot is not home. The relay status is used here only to sequence the cell and tell the operator why.

Why XIC: each bit is 1 in the state where a cycle may begin. What goes wrong, and this one matters: treating this rung as the safety function. The safety function lives in the safety relay or a safety controller, designed and validated to the performance level the risk assessment requires: ISO 12100 for the risk assessment, ISO 10218 for the robot cell, and ISO 13849-1 for the performance level. The standard PLC reads the relay’s status so it can sequence the cell and tell the operator why it will not start. If removing this rung would make the cell unsafe, the design is wrong, not the rung.

What does XIC look like in each vendor’s software?

Every PLC programming environment that offers ladder has the instruction. Rockwell Automation calls it XIC in both RSLogix 500 and Studio 5000 Logix Designer (more on how we work with those platforms on our Rockwell Automation page); Siemens, Mitsubishi Electric, Schneider Electric and Omron call it a normally open contact, and CODESYS-based software calls it a contact. The symbol is the same everywhere. What changes is the operand: a tag name, an absolute address, or a device number.

The same instruction across six vendorsA table of seven rows. Each row names a vendor and its programming software, the name the vendor gives the instruction, a small ladder contact with an example operand in that vendor's addressing style, and the text form. Rockwell Automation calls it XIC, Examine If Closed, in both Studio 5000 Logix Designer and RSLogix 500. Siemens TIA Portal, Mitsubishi Electric GX Works3, Schneider Electric Control Expert and Omron Sysmac Studio call it a normally open contact, and CODESYS-based software calls it a contact. All of them draw the same symbol and all of them are true when the operand is 1.VENDOR AND SOFTWARELADDERTEXT FORMRockwell AutomationStudio 5000 Logix DesignerXIC, Examine If ClosedStart_PBXIC(Start_PB)Rockwell AutomationRSLogix 500 (SLC 500, MicroLogix)XIC, Examine If ClosedI:0/4XIC I:0/4SiemensTIA Portal (S7-1200, S7-1500)Normally open contact"Start_PB"SCL: IF "Start_PB" THENMitsubishi ElectricGX Works3 (MELSEC iQ-R, iQ-F)Normally open contactX0Mnemonic: LD X0Schneider ElectricEcoStruxure Control Expert (Modicon M580)Normally open contactStart_PBST: IF Start_PB THENOmronSysmac Studio (NJ/NX)Normally open contactStart_PBST: IF Start_PB THENIEC 61131-3 / CODESYSCODESYS-based, incl. EcoStruxure Machine ExpertContactStart_PBST: IF Start_PB THEN
The same instruction in six notations. The ladder symbol barely changes; the name, the addressing and the text form are where the vendors differ.
VendorSoftwareName of the instructionExample operandText form
Rockwell AutomationStudio 5000 Logix Designer (ControlLogix, CompactLogix)XIC, Examine If ClosedStart_PB, Local:1:I.Data.0Rung text XIC(Start_PB); ST IF Start_PB THEN
Rockwell AutomationRSLogix 500 (SLC 500, MicroLogix)XIC, Examine If ClosedI:0/4, B3:3/14XIC I:0/4
SiemensTIA Portal (S7-1200, S7-1500)Normally open contact"Start_PB", %I0.0SCL IF "Start_PB" THEN; STL A "Start_PB" on S7-1500 only
Mitsubishi ElectricGX Works3 (MELSEC iQ-R, iQ-F)Normally open contactX0, M0MELSEC mnemonics: LD X0 starts a rung, AND X1 adds one in series
Schneider ElectricEcoStruxure Control Expert (Modicon M580)Normally open contactA named BOOL or EBOOL variable, or a %I addressST IF Start_PB THEN
OmronSysmac Studio (NJ/NX)Normally open contactA named BOOL variableST IF Start_PB THEN
IEC 61131-3 / CODESYSCODESYS-based software, including EcoStruxure Machine ExpertContactA named BOOL variableST IF Start_PB THEN
AutomationDirectCLICK Programming SoftwareNormally open contactX001, C1None; ladder only

Sources: Rockwell Automation 1756-RM003 and 1747-RM001; Siemens STL for S7-1500 online help; CODESYS online help; AutomationDirect CLICK online help; Phoenix Contact PLCnext Engineer help for the IEC 61131-3 contact definitions.

The same contact in each vendor’s editor

This is what the instruction looks like on screen in 26 programming environments from 18 vendors. They are ordered by how often you are likely to meet them: first the platforms that dominate North American plants (Rockwell Automation, Siemens, Omron, AutomationDirect, Schneider Electric and Mitsubishi Electric, which top Control Design’s readers’ choice ranking), then the machine-builder platforms you find on imported equipment, then regional and compact controllers. Each screenshot comes from the vendor’s own help or manuals or from a published tutorial, credited under it, and every one is framed the same way with the instruction ringed in amber. Pick a tab to switch software. Notice how little the symbol changes and how much the operand does: a tag with an alias, a file address, a named variable with a %I address, a device number, a plain-English name with spaces.

A few platforms are missing because we could not find a public screenshot of their ladder editor showing the contact. We searched each vendor’s online help and manuals and the published tutorials:

VendorSoftwareWhy it is not shown yet
Schneider ElectricEcoStruxure Control Expert (Modicon M340, M580)The Control Expert manuals could not be retrieved from Schneider Electric’s site and no public copy shows the LD editor. The Machine Expert - Basic and CODESYS screenshots above show Schneider Electric’s other two editors.
KEYENCEKV STUDIOThe manuals sit behind a download form and no public screenshot of the ladder editor turned up.
B&RAutomation StudioNo public screenshot of the LD editor, and B&R’s training modules could not be retrieved.
WAGOe!COCKPITNo public LD screenshot. e!COCKPIT is built on CODESYS, so its editor looks like the CODESYS one above.
InovanceInoProShop, AutoShopThe public manuals have no ladder editor figures. InoProShop is also built on CODESYS.

If you work in one of these, the instruction is the same normally open contact; we will add your editor when we capture it ourselves.

Sources for the ordering: Control Design 2023 readers’ choice awards for North America, and the ABI Research 2023 PLC competitive ranking for global reach. Neither publishes market share percentages, so we do not quote any.

Two differences are worth knowing before you switch platforms. Siemens describes its logic in terms of the result of logic operation (RLO): on an S7-1500, the STL A instruction checks an operand for 1 and ANDs it with the current RLO (the first check in a string simply loads it), which is the same series AND shown above. The S7-1200 has no STL at all, so there you work in LAD, FBD or SCL. And the MELSEC instruction mnemonics make the rung structure explicit, with LD to start a rung and AND and OR for series and parallel contacts, where Rockwell keeps that structure in the drawing.

If you are setting up a practice environment, I have walked through installing RSLogix 500 for free and TIA Portal for PLC programming in earlier posts.

Why won’t my XIC go true? A debugging checklist

When an XIC is not doing what you expect, the instruction itself is almost never wrong. The bit is not what you think it is, or the rung around it is not what you think it is. Work through the chain from the rung back to the field, in order, and stop at the first link that disagrees.

  1. Check the rung to its left. XIC can only pass true if the rung condition reaching it is true. A false instruction further left looks like a dead XIC.
  2. Look at the bit itself. Online, check the tag’s value in a tag monitor, not only on the rung. Make sure it is the same tag in the same scope: a program-scoped tag with the same name as a controller-scoped one is a classic trap.
  3. Check whether the routine is being scanned. An XIC in a routine that no JSR calls, or in a task that is inhibited, shows its last state and never changes.
  4. Follow the alias. Confirm which physical point the alias tag points at. A swapped alias is a five-minute fix that can take a day to find.
  5. Check the module and its connection. A faulted module or a lost I/O connection can leave an input tag holding a stale value. Check the module’s fault status before trusting the tag.
  6. Check the input card’s indicator. If the input’s status light is off, the problem is in the field: the device, the wiring, the fuse or the supply. If the light is on but the bit is 0, the problem is between the card and the tag: the module, the connection, the alias or a force.
  7. Look for a force. A forced bit holds its value whatever the field does. Most programming software flags forces prominently; check that flag before trusting what you see.
  8. Find every writer. Cross-reference the tag. If an OTE, an HMI or another controller also writes it, the value you see is whoever wrote last.
  9. Think about timing. A pulse shorter than the input filter or the update interval may never reach the tag, and a pulse shorter than the scan can reach the tag and still be missed, because the XIC only looks once per scan. For signals like that, use a latching or high-speed input module, a high-speed counter, or an event task.

Cross-referencing is the step people skip and the one that finds the most problems. It is also one of the reasons a written program standard and version control for PLC code pay for themselves: a tag with one writer is a tag you can reason about.

Common XIC mistakes

MistakeWhat happensFix
Choosing XIC or XIO from the switch labelStop buttons and permissives behave backwardsChoose from the value the bit has when the rung should pass
Normally open stop button programmed with XIOA broken wire looks like “not pressed”; the machine cannot be stopped from that buttonWire stops normally closed and use XIC
Expecting XIC to act onceThe action repeats every scan while the button is heldUse a one-shot (ONS) or a transition contact
Reading a command bit as if it were feedbackThe rung trusts what the program asked for, not what the device didXIC on the proof switch or the status bit
Using a standard PLC rung as the safety functionSafety depends on code that was never designed or validated for itSafety relay or safety controller; the PLC reads status only
Two rungs reading a fast-changing Logix inputThey disagree inside one scanBuffer the input word once at the start of the task, with CPS

Test yourself: an interview quiz on XIC

Ten questions, the kind I'd ask in an interview for a controls role to see whether someone really understands XIC. Pick an answer and the explanation appears straight away.

0 of 10 answered

  1. In one sentence, what does an XIC instruction test?

  2. A stop button is wired normally closed and nobody is pressing it. What is the value of its input bit?

  3. Same stop button, still not pressed. An XIC on its bit is:

  4. Why are stop buttons usually wired normally closed?

  5. Two XIC instructions in series on one rung behave like:

  6. An XIC's bit is 1, but an instruction to its left on the same rung is false. What does the XIC pass to the right?

  7. The same bit is 0. What do an XIC and an XIO on that bit each give, with a true rung coming in?

  8. An operator holds a button for two seconds and the scan time is 10 ms. On how many scans is the XIC on that button true?

  9. What does Siemens TIA Portal call the instruction Rockwell calls XIC?

  10. The tag Guard_Closed reads 0 in the tag monitor, but the input's status light on the card is on. Where do you look next?

Five harder XIC problems

These are the kind of problems that separate someone who has read about XIC from someone who has commissioned with it. Each one gives you the situation and the task. Try it on paper before you open the solution. The rungs are written in Logix rung text: XIC(tag) and XIO(tag) are contacts, square brackets with commas are parallel branches, and OTE(tag) is the output coil.

Problem 1: seal in on the command or on the contactor?

A conveyor motor has a normally open Start button, a normally closed Stop button, an overload relay contact wired so that OL_OK is 1 while the overload is healthy, and a contactor auxiliary contact M1_Aux that is 1 when the contactor has pulled in. Write the run rung for M1_Run. It must start on Start, stop on Stop or an overload, and must not restart by itself when the overload is reset. Then decide what the seal-in branch should read: the command bit M1_Run or the feedback M1_Aux.

Show the solution
XIC(Stop_PB) XIC(OL_OK) [XIC(Start_PB) ,XIC(M1_Run) ] XIO(M1_Fault) OTE(M1_Run);

Stop_PB and OL_OK are both 1 in the healthy state, so both are XIC in series. When the overload trips, OL_OK drops to 0, the rung goes false and M1_Run drops out, which breaks the seal. Resetting the overload brings OL_OK back, but the seal is already broken, so the motor waits for Start.

Seal on the command, and supervise the feedback separately. If you seal on M1_Aux alone, the contactor takes a few tens of milliseconds to pull in, and a quick tap on Start can be released before the feedback arrives, so the motor drops out. Feedback belongs in its own rungs: if M1_Run is 1 and M1_Aux stays 0 for longer than the contactor should take, a timer sets M1_Fault (failed to start); if M1_Aux drops while M1_Run is 1, that is an unexpected stop. The XIO on M1_Fault then takes the motor out until someone resets the fault. Timers get their own post in this series.

Problem 2: two rungs disagree about one input

In a ControlLogix program, rung 12 is XIC(Part_Present) OTE(Clamp_Close) and rung 47 is XIO(Part_Present) OTE(Request_Part). Part_Present is an alias for Local:2:I.Data.3, the module’s RPI is 2 ms, and the continuous task scans in about 18 ms. A few times a shift, the infeed sends a new part while the clamp is closing, and the trend shows Clamp_Close and Request_Part both at 1 at the end of the same scan. The rungs look mutually exclusive. Explain how this happens and fix it.

Show the solution

A Logix controller updates input tags asynchronously to the scan, every RPI, so Part_Present can change between rung 12 and rung 47 in the same scan. If the part leaves just after rung 12 runs, rung 12 saw 1 and closed the clamp, and rung 47 sees 0 and requests a part. Both outputs end the scan at 1.

Take one snapshot of the input at the start of the task and make every rung read the snapshot:

CPS(Local:2:I.Data, Inputs_Snap, 1);

Then point both rungs at Inputs_Snap.3, or alias Part_Present to it. CPS copies the data in one operation that an I/O update cannot interrupt. For a single DINT a plain copy is already safe; CPS earns its place when you buffer several words that must agree with each other. Every rung after it now sees the same value for the whole scan, which is how a process image controller behaves on its own. Making the two outputs depend on each other (an XIO on Clamp_Close in the request rung) is also worth doing, because it states the rule you actually want: never request a part while the clamp is closing.

Problem 3: the OEM filler’s status word

A filler sends a 32-bit status word into the DINT Filler_Status. Its interface specification numbers the bits 1 to 32, says bit 5 is “Ready to receive”, and says bit 16 is a heartbeat that toggles every 500 ms. A colleague wrote XIC(Filler_Status.5) OTE(Infeed_Enable) and the infeed behaves strangely. Find the problem, then write rungs so the infeed only runs when the filler is ready and its communication is alive.

Show the solution

Logix numbers bits from 0, so bit 5 in a specification that counts from 1 is Filler_Status.4, and the heartbeat is Filler_Status.15. The colleague is reading bit 6 of the specification. Confirm the mapping on the running machine before trusting it: watch the bit change while the filler goes in and out of ready, and check byte and word order if the data passes through a gateway.

The heartbeat check needs two timers, one for each value the bit can get stuck at:

XIC(Filler_Status.15) TON(HB_High, 1500, 0);
XIO(Filler_Status.15) TON(HB_Low, 1500, 0);
XIO(HB_High.DN) XIO(HB_Low.DN) OTE(Filler_Comms_OK);
XIC(Filler_Status.4) XIC(Filler_Comms_OK) OTE(Infeed_Enable);

If the connection drops, the tag often keeps its last value rather than going to zero, depending on how the data arrives, so the ready bit can stay at 1. Do not rely on either behaviour: the heartbeat check works whichever way it fails. If the data comes through an I/O module or adapter connection, check that connection’s fault status as well. While the heartbeat toggles, neither timer reaches 1.5 s, three missed toggles. If the bit freezes at either value, one timer finishes, Filler_Comms_OK drops and the infeed stops even though the frozen ready bit still says 1. Filler_Comms_OK is true for the first 1.5 s after power-up, which does no harm because the ready bit is still 0 then.

Problem 4: a fail-safe high level alarm that needs acknowledging

The tank from scenario 4 has been rewired fail-safe: the level switch contact is closed while the level is normal, so LSH_101_OK is 1 when all is well and 0 on a high level or a broken wire. Write two rungs. High_Alarm must come on for a high level or a wiring fault and stay on after the level drops until an operator presses Alarm_Ack on the HMI to reset it, and acknowledging must not clear it while the level is still high. Inlet_Valve must close on the alarm and stay closed until the alarm is cleared.

Show the solution
[XIO(LSH_101_OK) ,XIC(High_Alarm) XIO(Alarm_Ack) ] OTE(High_Alarm);
XIC(Fill_Request) XIC(LSH_101_OK) XIO(High_Alarm) OTE(Inlet_Valve);

The first branch turns the alarm on while the condition is present, and nothing on that branch looks at Alarm_Ack, so acknowledging cannot clear an active alarm. The second branch is a seal-in that holds the alarm after the level drops, until Alarm_Ack breaks it. With fail-safe wiring the alarm reads the switch with XIO, not XIC: the rule from this post again, chosen by the value the bit has when the rung should pass.

A few details matter in practice. Make sure the HMI button is momentary, or clear Alarm_Ack in the program after it has been read. If it sticks at 1 the alarm still comes on, but it no longer latches: it follows the level, so a brief high level can come and go with nobody seeing it. And the XIO(High_Alarm) in the fill rung keeps the valve closed until a person has seen the alarm, which is usually what operations want after a high level. Once the alarm is reset and the level is below the switch, though, this rung reopens the valve if Fill_Request is still 1. Real systems usually also require a fresh fill request or a lower level reading first; that is left out here to keep the exercise on XIC and XIO. And an OTE seal-in does not survive a power cycle: if the alarm must, use OTL and OTU on a retentive tag.

Problem 5: the input light is on but the XIC is false

An XIC on Guard_Closed, on rung 20 of the routine Cell_Seq in the program Cell, shows 0 and the cell will not start. You collect these facts:

  1. The status light for input 6 on the module in slot 4 is on.
  2. Local:4:I.Data.6 is 1 in the tag monitor.
  3. In Controller Tags, Guard_Closed is a BOOL and its value is 1.
  4. The cross reference for the controller-scoped Guard_Closed shows one writer: XIC(Local:4:I.Data.6) OTE(Guard_Closed) in the routine Map_Inputs of the program MainProgram, which is scanned every cycle.
  5. The Cell program was imported from a sister line last month.

What is wrong, and how do you fix it and stop it happening again?

Show the solution

Facts 3 and 4 say the controller-scoped Guard_Closed is 1 and written correctly, yet the XIC shows 0. The XIC must be reading a different tag with the same name. In Logix, when a program has its own tag with the same name as a controller-scoped tag, the logic in that program uses the program tag. The import in fact 5 most likely brought a program-scoped Guard_Closed with it. Nothing writes it, so it sits at 0. Map_Inputs lives in a different program, so it still writes the controller tag; only the logic inside Cell is redirected to the program tag.

Open the Cell program’s tags, confirm the duplicate, check that nothing in that program needs it, then delete it so the routine binds to the controller tag. To prevent it, make import reviews check for program tags that shadow controller tags, and use a naming standard that makes scope obvious. This is step 2 of the debugging checklist above, and it is the reason that step exists.

Where XIC fits in this series

XIC is the first instruction in Joltek’s PLC Programming guide, where the instruction glossary lists every common instruction and links to each full page as it is published. It comes first because most of what follows depends on it: an output coil usually does nothing until a rung of XICs and XIOs decides whether it gets power. The next pages follow the order you meet these instructions in real programs: XIO, then the output coil OTE, latch and unlatch (OTL and OTU), then the one-shot, timers and counters.

If you are building or rebuilding your own PLC skills, the PLC scan cycle explained from the SCADA side is a good companion to the timing section above. And if your plant’s controls team needs this kind of grounding on its own equipment and programs, that is what our hands-on PLC and SCADA training for plant teams is for.

References and further reading

  1. Logix 5000 Controllers General Instructions Reference Manual (1756-RM003) · Rockwell AutomationExamine If Closed (XIC): operand, execution table, prescan and postscan.
  2. SLC 500 Instruction Set Reference Manual (1747-RM001) · Rockwell AutomationXIC and XIO in RSLogix 500, with input, output and timer done-bit examples.
  3. ControlLogix 5590 Controllers User Manual: Determine When I/O Data Is Updated (1756-UM900) · Rockwell AutomationI/O data is refreshed asynchronously to logic execution.
  4. STL for S7-1500: A, AND logic operation · Siemens, TIA Portal V20 online help
  5. SIMATIC S7-1500 Cycle and Response Times, Function Manual · SiemensThe process image of the inputs is read at the start of each cycle.
  6. CODESYS LD/FBD: Contact · CODESYS Group, online help
  7. LD Language Elements · Phoenix Contact, PLCnext Engineer helpNormally open, normally closed and transition-sensing contacts as IEC 61131-3 describes them.

← PLC Programming guide and instruction glossary

Have a project that needs technical ownership?

Send us the situation. If it is not something we should take on, we will say so.

The Plant-Side Brief

The weekly brief for the people who own a plant’s control systems.

One email every Wednesday for engineering and operations leaders responsible for controls, SCADA, MES and OT networks. Skim the top in two minutes; read the Deep Dive when you have fifteen.

  • One modernization problem, worked through to cost, risk and a schedule you can defend. The Deep Dive.
  • End-of-support dates before they reach your plant Windows, servers, controllers and HMI software. Lifecycle Watch.
  • A checklist your engineers can run that week not a framework to admire. Field Kit.
  • Every number sourced, no vendor agenda we are paid by plants, never by vendors.