The output image: why your coil did not work
A coil sets a bit in memory, not a terminal. Understanding when that memory reaches the real world explains a whole class of bugs.
Short answer
A coil writes to the output image in memory, not directly to the terminal. The whole image is copied to the physical outputs once, at the end of the scan. Within the program, a coil is visible immediately to any rung solved after it, and only on the next scan to any rung solved before it.
A coil in ladder logic looks like it energises a terminal. It does not. It sets a bit in a block of memory called the output image, and the controller copies that whole block to the physical terminals once, after the entire program has been solved.
Why it works that way
Consistency. If outputs changed the instant each coil solved, a machine would see them arrive in program order, staggered across the scan. Writing them together means every output changes at the same instant, which is what the wiring diagram implies and what the machine expects.
The consequence people trip over
Inside the program, the output image is just memory, and memory is readable immediately. A rung solved after your coil sees the new value. A rung solved before it sees the old one.
That asymmetry is the whole bug class. Two rungs that look independent behave differently depending on which is first, and nothing in the rung itself tells you so.
If a rung works only every other scan, or takes two presses to respond, look at the order before you look at the logic.
How to check it
Put the suspect bit in a trend or a watch table and step the program one scan at a time. A one-scan lag is obvious when you can see individual sweeps and invisible at full speed.
Common questions
- What is the output image table?
- A block of memory holding the intended state of every physical output. Coils write to it during the scan, and the controller copies the whole block to the terminals once the program has finished solving. It exists so that outputs change together rather than flickering as rungs execute.
- Can a coil be read by another rung in the same scan?
- Yes, if that rung comes after it. Rungs solve in order against the same memory, so a later rung sees what an earlier coil just wrote. An earlier rung sees the previous scan's value, because it had already been solved.
Keep reading
- Safety
SIL or PL: which one does your machine need?
Two standards, two scales, and one machine. Which one applies, how they map to each other, and why the answer is usually ISO 13849.
- Safety
Categories B, 1, 2, 3 and 4, in plain terms
Five architectures, what a single fault does to each, and the practical wiring that goes with them.
- Safety
Safety relay or safety PLC: how to decide
One is a wiring decision, the other is a programming one. The count of safety functions, not the size of the machine, is what settles it.