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.

Anatomy of a ladder rungL1 (hot)L2 (return)| ||/|( )NORMALLY OPENtrue when input ONNORMALLY CLOSEDtrue when input OFFOUTPUT COILenergized if path closedRead left to right: inputs (contacts) decide whether the output (coil) turns on.
Anatomy of a rung. Contacts are inputs on the left; the coil is the output on the right.

Two symbols do most of the work:

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:

  1. Start at the left rail. Assume power is available and trace toward the right.
  2. 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.
  3. Follow series contacts as AND. If any series contact in the path is open, the path is broken there and the output stays off.
  4. Follow parallel branches as OR. If any branch completes the path around a broken contact, power continues.
  5. Check whether the coil is reached. If an unbroken path arrives at the coil, the output energizes; otherwise it stays de-energized.
  6. 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.

Motor start/stop with seal-in| |START (NO)| |MOTOR (seal-in)|/|STOP (NC)( )MOTORThe Motor seal-in contact holds the rung closed after Start is released.
Motor start/stop with seal-in. The Motor's own contact latches the rung; the normally closed Stop breaks it.

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.

LanguageStyleBest at
Ladder Diagram (LD)Graphical, relay-style rungsDiscrete logic, interlocks, anything electricians must troubleshoot
Function Block Diagram (FBD)Graphical, wired blocksContinuous/process control, signal flow, reusable blocks
Structured Text (ST)Text, Pascal-likeMath, loops, complex algorithms hard to draw as rungs
Sequential Function Chart (SFC)Graphical steps and transitionsStep-by-step sequences and state machines
Instruction List (IL)Text, assembly-likeLegacy code; deprecated in the 2025 fourth edition
The IEC 61131-3 languages. The 2025 fourth edition removed Instruction List, leaving four.

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:

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.