Ladder logic is a graphical programming language for PLCs that looks like an electrical relay wiring diagram. Logic is drawn as horizontal "rungs" between two vertical power rails; each rung reads input contacts on the left and energizes an output coil on the right when the contacts form a complete path.
That resemblance to relay wiring is not an accident, and it is the whole reason ladder logic has outlived the technology it imitates. This guide covers the rails, contacts, and coils; why the language looks the way it does; a worked motor start/stop example you can read line by line; and how the events a rung represents become the data an operations layer can actually use.
Why does ladder logic look like relay wiring?
Ladder logic looks like relay wiring because it was designed to replace relay wiring without retraining the people who maintained it. Before PLCs, machine control was done with banks of electromechanical relays wired into cabinets. Changing the logic meant rewiring. When the PLC arrived at the end of the 1960s to replace those cabinets, the engineers who would program it were the same electricians who had spent careers reading relay ladder diagrams. So the first PLC language mimicked the diagrams they already knew: two rails, rungs between them, and symbols for contacts and coils.
The payoff is durability. A plant electrician can stand at an HMI, look at a rung, and see which contact is not made, which switch, sensor, or interlock is stopping the output, without a computer-science background. Half a century later, ladder logic is still the most widely used PLC language for exactly this reason: the people who troubleshoot machines at 2 a.m. can read it.
What are rungs, contacts, and coils?
A ladder program is a stack of rungs. Each rung is a single logical statement: if this input condition is true, drive this output. The two vertical lines are the power rails, imagine the left rail as always "hot" and the right rail as the return. Power flows left to right across a rung only if the contacts on that rung form an unbroken path.
Two symbols do most of the work:
- Contacts are inputs. A normally open contact passes power when its input is ON. A normally closed contact passes power when its input is OFF, so it is the logical inverse. A contact can reference a physical input like a push button, or an internal bit set elsewhere in the program.
- Coils are outputs. A coil energizes when the rung has a complete path from the left rail to the coil. That output might be a physical device such as a motor contactor, or an internal bit that other rungs read back as a contact, which is how one rung's result becomes another rung's input.
The geometry encodes Boolean logic. Contacts in series (one after another on the same rung) are a logical AND, every contact must be closed. Contacts in parallel (stacked as branches) are a logical OR, any one branch completing the path is enough. That is the entire logical vocabulary: AND by series, OR by parallel, NOT by choosing a normally closed contact.
How do you read a ladder rung?
Reading a rung is a fixed procedure. Work it the same way every time and even a dense program becomes legible:
- Start at the left rail. Assume power is available and trace toward the right.
- Evaluate each contact against its current input. A normally open contact passes power only if its bit is ON; a normally closed contact passes only if its bit is OFF.
- Follow series contacts as AND. If any series contact in the path is open, the path is broken there and the output stays off.
- Follow parallel branches as OR. If any branch completes the path around a broken contact, power continues.
- Check whether the coil is reached. If an unbroken path arrives at the coil, the output energizes; otherwise it stays de-energized.
- Remember it repeats. The PLC re-evaluates every rung, top to bottom, on each scan, typically every few milliseconds, so the rung reflects live inputs, not a one-time decision.
That last point ties ladder logic to the PLC scan cycle: the controller reads all inputs, solves the ladder rung by rung, then writes all outputs, and loops. A coil is not a one-shot command; it is a condition the PLC re-checks thousands of times a minute.
Can you walk through a real example?
The classic first program is a motor start/stop with a seal-in, and it shows why parallel branches matter. You have a normally open Start button, a normally closed Stop button, and a motor. Press Start and the motor should run; release Start and it should keep running; press Stop and it should quit. The trick is the seal-in contact.
Trace it: press Start and the normally open Start contact closes; power runs through the (normally closed) Stop contact to the Motor coil, and the motor energizes. Because the coil is now ON, its seal-in contact, the parallel Motor branch, also closes. Now release Start: the Start contact opens, but power still reaches the coil through the seal-in branch. The motor stays running, latched by its own output. Press Stop and the normally closed Stop contact opens, breaking the only path to the coil; the motor stops and the seal-in drops out with it. Three components, one rung, and a machine that behaves the way an operator expects.
Is ladder logic the only PLC language?
No. Ladder logic is one of the languages defined by IEC 61131-3, the international standard for PLC programming. The standard was first published in 1993 to make PLC code portable across vendors, and it originally defined five languages. Ladder is the most popular, but the others each have a place.
| Language | Style | Best at |
|---|---|---|
| Ladder Diagram (LD) | Graphical, relay-style rungs | Discrete logic, interlocks, anything electricians must troubleshoot |
| Function Block Diagram (FBD) | Graphical, wired blocks | Continuous/process control, signal flow, reusable blocks |
| Structured Text (ST) | Text, Pascal-like | Math, loops, complex algorithms hard to draw as rungs |
| Sequential Function Chart (SFC) | Graphical steps and transitions | Step-by-step sequences and state machines |
| Instruction List (IL) | Text, assembly-like | Legacy code; deprecated in the 2025 fourth edition |
Real programs mix them. A machine might use ladder for its safety interlocks, structured text for a recipe calculation, and a sequential function chart for the startup sequence, all in one project. The choice is about who has to maintain each part: rungs an electrician can debug at the machine, text for the math nobody wants to draw. A well-built program keeps the interlocks and fault logic in ladder precisely because those are the rungs someone will be reading under pressure when a line is down.
How does a rung become plant-floor data?
Every meaningful event on a machine is a bit in the PLC. A rung that stops a motor sets a fault bit. A rung that counts a part increments a register. A rung that latches a guard-open condition holds an interlock. Those bits and registers, the PLC's tags, are the cheapest, most accurate source of machine data in the building, because the machine already computes them to run at all. The problem is that they usually stay trapped at Levels 1 and 2 of the ISA-95 stack, visible on the local HMI and nowhere else.
Reading those tags through a gateway is how a downtime event becomes a timestamped record instead of a guess, and how machine monitoring and true OEE get computed from the source rather than estimated from a clipboard. That is a large part of why controls data matters beyond the control cabinet: the same seal-in rung that keeps a motor running also knows, to the millisecond, when the motor stopped and why. Surface that alongside the operator's note and the maintenance history and you have context instead of scattered data silos. It is the foundation a manufacturing operating system like Harmony builds on: read what the PLCs already know, add the paper and tribal knowledge the tags cannot hold, and give every role one place to see it, as plants like CLS did without touching the control logic. From there, adjacent tooling like predictive maintenance and smart-factory analytics has clean signals to work with.
Ladder logic by the numbers
The primary reference for ladder logic and the other PLC languages:
- Ladder Diagram is one of the languages standardized by IEC 61131-3 first published in 1993 with the current fourth edition released in 2025 (IEC Webstore, IEC 61131-3:2025).
- The standard originally defined five languages; the fourth edition removed Instruction List, leaving four (Ladder Diagram, Function Block Diagram, Structured Text, Sequential Function Chart).
- IEC 61131-3 is stewarded in practice by PLCopen the vendor-independent body that promotes portable, standards-based PLC programming (PLCopen, IEC 61131-3).
The point of the standard is portability: ladder logic written to IEC 61131-3 carries the same meaning across vendors, which is why an electrician trained on one platform can read a rung on another.