Symptom
A rung shows true online but the equipment does not respond, or the equipment responds when the rung is false, or a value in the program is not what the arithmetic should produce, or a change made to the program has no visible effect.
The short answer
Logic Not Executing As Expected
When logic that reads correctly does the wrong thing, the program is usually doing exactly what it says, in an order or a context the reader did not see. The last rung to write a bit wins; a routine that is never called never runs; a force overrides the rung; a comparison of two floats for equality never comes true; and an instruction that looks like the one you meant behaves differently. Find the discrepancy by watching the rung online, then searching for every other place that touches the same tag.
Key points
- Search every reference to the output tag. A second rung writing it later in the scan overrides the one you are looking at.
- Confirm the routine is actually called and its task is actually scheduled. Logic that is not scanned does nothing, however correct.
- Check for forces and for online edits that were never assembled.
- Float equality, integer overflow, and mismatched data types produce results that look like logic errors.
- The instruction is not always the one it looks like: latch against output, one-shot rising against falling, retentive timer against on-delay.
Possible causes and what to check
| Possible cause | What to check |
|---|---|
| Duplicate destructive outputs | Cross reference the tag. Two OTE instructions on one bit leave it in the state of the last one scanned. The first rung appears true and ignored. |
| Routine not called, or task not scheduled | Find the jump to the routine and confirm its rung is true. Confirm the program containing it is scheduled in a running task and not inhibited. |
| Forces installed | The software shows forces enabled. A force on the input or the output makes the rung irrelevant. |
| Online edit pending | An edit that was accepted but not assembled or tested is not executing. The rung shows the edit; the controller runs the old logic. |
| Scan order | A value written late in the scan is read early in the next one. Logic that expects a value set by a later rung to be current in an earlier rung is one scan behind. |
| Float compared for equality | Two REALs that should be equal differ in the last digit and the equals instruction never fires. Compare with a tolerance. |
| Integer overflow or truncation | An INT that rolled past 32,767, or a REAL copied into an INT and truncated. Watch the value online through the arithmetic. |
| Wrong instruction | A latch where an output was intended holds forever. A one-shot on the wrong edge fires at the wrong time. A retentive timer never resets. Read the instruction help, not the symbol. |
| Indirect address pointing elsewhere | An array index or a pointer that is not the value assumed. Watch the index online. |
| Alias or mapping to the wrong tag | The tag in the rung is an alias for a different base tag than expected, or the I/O mapping moved with a module. |
Watch it, do not read it
Reading logic on a screen and reasoning about what it should do is where the trouble started. Go online and watch the rung execute: which instructions are true, what the values are, and whether the output changes when the rung does. The controller does not do what the logic looks like; it does what the logic is, in the order it is scanned, with the data it has at that moment. Watching shows that; reading does not.
The scan is the first suspect
A controller writes outputs at the end of the scan, so if two rungs write the same bit, only the last one matters. This is the single most common cause of a rung that is true and apparently ignored, and the fix is a cross reference: find every instruction that writes the tag. A bit written by an output instruction in one routine and cleared by a move or a clear in another, or written in two routines that were both copied from a template, is a bit whose state depends on scan order alone.
Is it even running?
A routine executes only when something calls it. A routine created and never given a jump, a jump on a rung whose condition is never true, or a program placed in a task that is inhibited or was never scheduled, contains logic that is correct, visible, and dead. Online, a routine that is not being scanned shows no live values, or shows them frozen, and that is the tell. Confirm the call chain from the main routine down before trusting anything inside.
Data that lies
- Float equality
- A setpoint of 6.0 entered from the HMI and a level of 6.0 calculated from counts are not the same thirty-two bits. An equals instruction between them is false. Use a greater-than-or-equal with a deadband, or compare within a tolerance.
- Integer overflow
- An INT that counts past 32,767 becomes negative. Arithmetic that overflows sets a status flag on most platforms and produces a wrong number that the logic then acts on.
- Truncation
- A REAL moved into an INT loses its fraction, and on some platforms rounds while on others it truncates. A calculation done in integers divides and drops the remainder.
- Stale data
- A value from a communication instruction or a consumed tag that stopped updating holds its last value. The logic acts on a number that was true an hour ago.
The instruction that is not the one you meant
Ladder symbols are compact and several of them look alike. An output latch holds the bit until an unlatch clears it, and looks almost like an output. A one-shot rising fires on the false-to-true transition; the falling version fires on the other, and both look like a contact. A retentive timer keeps its accumulated value when its rung goes false and needs a reset instruction; an on-delay timer resets itself. A negated output is on when the rung is false. When a rung behaves oddly, open the instruction help and read what the instruction actually does before assuming the logic around it is wrong.
After an edit that did nothing
A change that has no effect is either not executing or is being overridden. Online edits go through accept, test, and assemble on most platforms, and an edit that was accepted and never assembled shows in the editor and does not run. A download to the wrong controller, or a save without a download, leaves the plant on the old program. Confirm the controller is running the program you think it is by comparing the project against the controller.
Frequently asked questions
- The rung is true online but the output does not turn on. Why?
- Almost always another rung writing the same output later in the scan. Cross reference the output tag. If nothing else writes it, check for a force, then for the routine not actually being scanned.
- Why does my equals comparison never work on a level setpoint?
- Because the two floating point values differ in the last bit and are never exactly equal. Compare with a tolerance, or use greater than or equal and less than or equal with a deadband.
- I made an online edit and nothing changed.
- The edit is accepted but not assembled, so the controller still runs the old rung. Or the edit is in a routine that is not called. Or the edit was made to a project that was never downloaded. Check each in that order.
- What is a destructive output?
- An instruction that unconditionally writes a bit every scan, such as a standard output coil. Two of them on the same bit fight, and the last one scanned wins. Use one output per bit and combine the conditions on its rung.
Related topics
- The PLC Scan CycleRead inputs, solve logic, write outputs, housekeeping. Understanding scan order explains most PLC behavior that looks wrong at first glance.
- Ladder Logic FundamentalsRungs, contacts, coils, and the relay conventions the language inherited — plus the patterns you will meet in almost every industrial program.
- Controller Memory and AddressingHow a controller organizes its data: data tables and tags, the input and output images, the elementary data types and what they hold, and the naming discipline that keeps a program readable years later.
- Outputs Not EnergizingThe program says the output is on and the equipment is not running. Where the signal gets lost between the output image and the field device, and how to find the point in a few measurements.
- Program OrganizationStructuring a controller program so that someone else can maintain it: a layout that follows the plant, one routine per job, standard device blocks, I/O mapped in one place, a fixed execution order, naming that means something, and comments that say why.
- Processor FaultedA PLC with its fault light on and no logic running. How to read what it is telling you, the causes in order of likelihood, and how to restart it without repeating the fault.
Direct contact
Have a controls question?
Reach Eric Sullivan directly about anything on this site, a controls or automation topic, or one of his personal projects.