A ladder diagram is a graphical programming language used to program the industrial computers known as programmable logic controllers (PLCs). It gets its name from its appearance: two vertical lines (called rails) with horizontal lines (called rungs) stretching between them, forming a shape that looks like a ladder. Each rung represents one logical operation, and the whole diagram defines how a machine or process should behave. Ladder diagrams are one of four standard PLC programming languages defined by the international standard IEC 61131-3.
Where Ladder Diagrams Come From
Before PLCs existed, factories controlled machines using physical relay panels. Electricians wired relays, switches, and contacts together on large racks, and they documented those wiring designs with a specific style of schematic. That schematic style is what we now call a ladder diagram. When PLCs replaced relay panels starting in the late 1960s and 1970s, manufacturers kept the same visual format so that electricians and technicians could transition to the new technology without learning an entirely unfamiliar language.
This history matters because it explains why ladder logic looks the way it does. It isn’t an abstract programming concept. It’s a direct digital translation of the physical relay circuits that came before it. If you can trace a path through an electrical schematic, you can read a ladder diagram.
How a Ladder Diagram Is Structured
The two vertical lines on the left and right edges are the rails. The left rail represents the power source, and the right rail represents ground or neutral, just like the two sides of an electrical circuit. Horizontal rungs connect the rails, and each rung contains symbols that define one piece of the control logic.
A rung reads from left to right. The left side holds input conditions (sensors, buttons, switches), and the right side holds outputs (motors, valves, indicator lights). The logic symbols in between determine whether those inputs create a valid path for “power” to flow across the rung and energize the output. If the conditions on a rung are satisfied, the output activates. If not, it stays off.
Core Symbols You’ll See on Every Rung
Ladder diagrams use a small set of symbols that combine to create complex behavior:
- Normally Open (NO) contact: Drawn as a gap in the rung line. It represents a condition that is false by default and becomes true when activated, like a push button that completes a circuit when pressed.
- Normally Closed (NC) contact: Drawn with a diagonal slash through the contact symbol. It represents a condition that is true by default and becomes false when activated. This is how you express “not” logic, such as an emergency stop that breaks the circuit when triggered.
- Output coil: Drawn as a circle (or parentheses) on the right side of the rung. It represents the device being controlled. When the logic path through the rung is complete, the coil energizes, and the output turns on.
These three symbols handle the vast majority of basic control tasks. Everything else builds on them.
How Ladder Logic Represents Boolean Operations
Every ladder diagram is really just a visual way of expressing Boolean logic, the same AND, OR, and NOT operations used in all digital systems. The mapping is straightforward:
- AND logic: Place two contacts in series on the same rung. Power can only flow through if both contacts are true. Contact A and Contact B must both be active for the output to energize.
- OR logic: Place two contacts on parallel branches of the same rung. Power can flow through either path, so the output turns on if Contact A or Contact B (or both) is active.
- NOT logic: Use a Normally Closed contact. The output is energized when the contact is not activated, and it de-energizes when the contact activates. This inverts the logic.
By combining series and parallel arrangements of NO and NC contacts, you can build any logical expression a machine requires. A single rung might check that a safety gate is closed (NC contact), a start button has been pressed (NO contact), and no fault condition exists (another NC contact), all before energizing a motor coil.
How a PLC Executes a Ladder Program
PLCs don’t run ladder logic the way a desktop computer runs software. Instead, they operate on a repeating scan cycle that follows the same sequence every time. Almost all PLCs worldwide handle this the same way.
First, the CPU reads the state of all physical inputs (sensors, switches, buttons) and stores them in a memory table called the input table. Next, it evaluates the ladder program rung by rung, starting at the top and working down. Within each rung, it evaluates from left to right. As it processes the logic, it updates an output table in memory. After it finishes evaluating every rung, it writes the output table to the physical outputs, turning real-world devices on or off. Then the cycle repeats.
This scan cycle typically takes just milliseconds, so the system responds to changes in real time from the operator’s perspective. One important detail: because the PLC reads all inputs at the start of the scan and writes all outputs at the end, changes to inputs that happen mid-scan won’t be reflected until the next cycle.
Timers and Counters
Beyond simple on/off logic, ladder diagrams include function blocks that handle time and counting. These appear as rectangular boxes inserted into rungs.
A timer on-delay (TON) block starts counting time when its input goes true. Once the set time elapses (for example, one second), its output activates. This is useful when you need a delay, like waiting for a conveyor to reach speed before releasing product. A timer off-delay (TOF) works in reverse: the output stays on for a set duration after the input turns off. A pulse timer (TP) generates a fixed-length pulse regardless of how long the input stays active.
Counters track how many times an event occurs. An up/down counter (CTUD) increments its value each time it detects a rising edge on its count-up input and decrements on its count-down input. It has a preset value, and when the counter reaches that limit, it sets an output flag to true. This is how a bottling line might count 24 bottles before signaling a packing station to close a case.
Where Ladder Diagrams Are Used
Ladder logic dominates industrial automation. You’ll find it controlling conveyor systems that route materials based on sensor readings, robotic arms that sequence through pick-and-place movements, bottling and labeling lines in beverage plants, cement batching operations, and package sorting in logistics warehouses. It’s also heavily used for machine safety systems, implementing interlocks and emergency stop circuits that prevent accidents.
The reason for this dominance is practical. Maintenance technicians on a factory floor often have electrical backgrounds rather than computer science degrees. Ladder logic looks like the wiring schematics they already know how to read. When a machine stops running at 2 a.m., the technician troubleshooting it needs a format they can interpret quickly.
Why Ladder Diagrams Are Easy to Troubleshoot
One of the biggest advantages of ladder logic over text-based programming languages is visual debugging. Modern PLC software provides live animation of the ladder diagram, highlighting the path of “power flow” through each rung in real time. You can see exactly which contacts are true, which are false, and where a logic path breaks down.
If a motor isn’t starting, you can open the ladder program, find the rung that controls that motor’s coil, and instantly see which input condition isn’t being met. Maybe a proximity sensor isn’t detecting a part, or a safety interlock is open. The visual format turns what could be an hour of detective work into a few seconds of reading highlighted lines on a screen.
Ladder Diagrams vs. Other PLC Languages
IEC 61131-3 defines four PLC programming languages. Ladder Diagram (LD) and Function Block Diagram (FBD) are graphical. Instruction List (IL) and Structured Text (ST) are text-based. Structured Text resembles conventional programming languages like Pascal and is better suited for complex math, data manipulation, and algorithms. Function Block Diagram uses interconnected blocks and is popular for continuous process control.
Ladder logic remains the most widely used of the four, particularly in discrete manufacturing where machines need to respond to binary conditions: something is on or off, open or closed, present or absent. For tasks that involve heavy computation or string handling, Structured Text is typically the better choice. Many real-world PLC programs mix both, using ladder logic for the sequential machine control and Structured Text for the data processing portions.

