Ladder Diagram: What It Is, How It Works, and How to Read One
This is a free printable ladder diagram: download the diagram as SVG or open it and print to paper or PDF.
A ladder diagram (LD) is the graphical PLC programming language defined in IEC 61131-3 that represents control logic as horizontal rungs between a left and right power rail — directly mirroring the relay panels electricians used before programmable controllers existed. Each rung is a boolean equation: contacts on the left are conditions, and the output coil on the right is the result. Understanding ladder diagrams is the foundation of all industrial PLC programming.
## What Is a Ladder Diagram?
A ladder diagram is one of five programming languages specified by IEC 61131-3 — the international standard governing PLC programming. The other four are Structured Text (ST), Function Block Diagram (FBD), Sequential Function Chart (SFC), and the now-deprecated Instruction List (IL). Of these, Ladder Diagram (LD) remains the most widely used worldwide because it was designed to be readable by electricians who already understood relay-logic schematics.
The name comes from the visual shape: two vertical lines representing power rails (left power rail and right power rail) are bridged by horizontal rungs, creating an image that resembles a ladder. Logic flows from left to right across each rung. If the conditions on a rung evaluate to TRUE — meaning there is a continuous logical path from the left rail to the right rail — the output coil or instruction at the far right is energised.
## History: From Relay Logic to PLC Ladder Diagram
Before PLCs, machine control was implemented with physical relay panels — large metal cabinets populated with electromagnetic relays, timers, and contactors wired together with copper conductors. Each relay had a coil (the output) and a set of contacts (the inputs to downstream logic). Changing the control logic meant re-wiring the panel, which was expensive and time-consuming.
In 1968, Dick Morley and the team at Bedford Associates developed the MODICON 084, widely recognised as the first commercial PLC, specifically for General Motors. To ease adoption among plant electricians, the programming language was designed to mirror the relay schematic drawings those engineers already understood. The result was ladder logic — a software language that looks like a relay schematic but executes on a microprocessor.
## Anatomy of a Ladder Diagram: Rails, Rungs, Contacts, and Coils
Every ladder diagram has the same structural elements. The **left power rail** is the logical equivalent of the live conductor — it represents a logical TRUE. The **right power rail** is the neutral or return. **Rungs** are horizontal lines connecting the two rails; each rung contains the logic for one output or function.
On each rung you place **contacts** and **coils**. Contacts represent conditions being tested — they examine the state of a bit in the PLC's data table. An **XIC (Examine If Closed)** contact, drawn as -| |-, is a normally-open (NO) contact: it passes current (evaluates TRUE) when its associated bit is 1. An **XIO (Examine If Open)** contact, drawn as -|/|-, is a normally-closed (NC) contact: it passes current when its associated bit is 0. These map directly to the NO and NC contacts on a physical relay.
At the right end of a rung sits the **output instruction**. The most common is the **OTE (Output Energize)** coil, drawn as -( )-, which sets its associated bit to 1 while the rung is TRUE and to 0 when the rung is FALSE. For latching behaviour — where the output must stay ON even after the input condition disappears — you use **OTL (Output Latch)** and **OTU (Output Unlatch)** pairs, also called SET and RESET coils in IEC/Siemens notation.
## Core Symbols — Quick Reference Table
The specifications section below lists every essential instruction with its symbol and truth table. The critical principle is that contacts in **series** implement AND logic (all must be TRUE), contacts in **parallel branches** implement OR logic (any one path TRUE is sufficient), and a single NC contact implements NOT logic.
## How a PLC Executes Ladder Logic: The Scan Cycle
Understanding the PLC scan cycle is essential for writing correct ladder diagrams. The scan cycle has four phases that repeat continuously:
**Phase 1 — Input Scan:** The PLC reads the physical state of every input terminal and copies those states into the input image table (a block of memory). This snapshot is used throughout the rest of the scan so that input values do not change mid-scan even if the physical signal changes.
**Phase 2 — Program Execution (Logic Solve):** The PLC executes every rung in the ladder program from top to bottom, left to right. It reads contact states from the image table, evaluates the rung's boolean equation, and writes the result to the output image table. On Allen-Bradley controllers this is called the Result of Logic Operation (RLO).
**Phase 3 — Output Scan:** The PLC copies the output image table to the physical output terminals, energising or de-energising the actual field devices (contactors, valves, indicator lights).
**Phase 4 — Housekeeping:** Internal diagnostics, communications, and program maintenance tasks are handled. This is when online edits take effect on controllers that support them.
A typical scan cycle for a small program takes 1–20 milliseconds. Scan time increases with program size and the number of instructions. This matters for very fast sensors: a signal that pulses shorter than one scan time may be missed unless you use hardware interrupt routines or one-shot instructions.
## AND, OR, and NOT Logic in Ladder Diagrams
All digital control logic reduces to combinations of three boolean operations, and ladder diagrams implement all three elegantly.
**AND logic** is implemented by placing XIC or XIO contacts in series on the same rung. A press-safety circuit, for example, requires both the guard-closed limit switch (I:0/2) AND the start pushbutton (I:0/0) to be closed before the press output (O:0/0) can energise: XIC I:0/0, XIC I:0/2, OTE O:0/0. Both contacts must be TRUE for the rung to be TRUE.
**OR logic** is implemented by placing parallel branches on the same rung. A process alarm that fires when a high-temperature sensor (I:0/3) OR a high-pressure sensor (I:0/4) is active uses a parallel branch: one branch has XIC I:0/3, the other has XIC I:0/4, and both connect to OTE Alarm (B3:0/1). Either path TRUE energises the output.
**NOT logic** is simply a single XIO contact. A normally-closed emergency-stop button on the input card means its bit is 1 when the button is not pressed (circuit closed) and 0 when pressed (circuit opened). An XIO contact on that bit is TRUE when the bit is 0 — i.e., when the E-stop has been pressed. This is the fail-safe wiring principle: a broken wire or unpowered sensor also de-energises the contact, preventing the machine from starting.
## The Seal-In (Latch) Circuit: Start/Stop Motor Example
The most fundamental industrial ladder program is the start/stop motor seal-in circuit — every PLC programmer must understand this before anything else.
**Rung 1:** XIC Start (I:0/0), XIO Stop (I:0/1), XIC OL_contact (I:0/2), OTE Motor (O:0/0). In parallel with XIC Start, place XIC Motor (O:0/0). This parallel contact is the seal-in.
When the Start button is pressed, I:0/0 goes to 1, the rung evaluates TRUE, and the Motor output O:0/0 energises. As soon as the Motor bit is 1, the seal-in contact XIC Motor also becomes TRUE — so even after the operator releases the momentary Start button (I:0/0 returns to 0), the Motor bit holds itself energised through its own contact. The NC Stop contact XIO I:0/1 is normally 1 (button not pressed, circuit closed to PLC input), allowing the rung to pass. When Stop is pressed, I:0/1 goes to 0, the XIO contact opens, the rung goes FALSE, and the motor de-energises.
The NC overload relay contact (OL) in series provides motor protection: if the thermal overload trips, its contact opens, the bit goes to 0, and the XIC OL_contact opens, cutting power to the motor regardless of other conditions.
## Timers in Ladder Diagrams: TON and TOF
The **TON (Timer On Delay)** instruction accumulates time while its enable rung is TRUE. Once the accumulated value (ACC) reaches the preset (PRE), the timer's Done bit (DN) turns ON. Example: a pump fill-delay of 10 seconds. Rung 1: XIC Level_High (I:0/5), TON T4:0 PRE=10000 (10,000 ms = 10 s). Rung 2: XIC T4:0/DN, OTE Pump (O:0/1). The pump only starts 10 seconds after the level sensor activates — preventing cavitation on surge.
The **TOF (Timer Off Delay)** instruction works in reverse: its Done bit turns ON immediately when the enable rung goes TRUE, and starts timing only when the rung goes FALSE. The DN bit stays ON during the delay, then turns OFF. Example: a cooling fan that continues running for 30 seconds after a motor stops to prevent thermal damage. Rung 1: XIC Motor_Running (B3:0/0), TOF T4:1 PRE=30000. Rung 2: XIC T4:1/DN, OTE Fan (O:0/2).
The **RTO (Retentive Timer On)** accumulates time across multiple enable cycles — the ACC value is not reset when the rung goes FALSE. This is used for total-hours-run meters and maintenance interval tracking. A RES (Reset) instruction on a separate rung clears the ACC when needed.
## Counters in Ladder Diagrams: CTU Example
The **CTU (Count Up)** instruction increments its accumulated count by 1 on each FALSE-to-TRUE transition of its enable rung. When ACC reaches PRE, the Done bit turns ON. Example: stop a conveyor after 100 parts pass a photosensor. Rung 1: XIC PartSensor (I:0/7), CTU C5:0 PRE=100. Rung 2: XIO C5:0/DN, OTE Conveyor (O:0/3). Rung 3 (reset): XIC CycleComplete (B3:0/5), RES C5:0.
**CTD (Count Down)** counts from a preset value down to zero, setting its Done bit when ACC reaches 0. The **CMP** and comparison instructions **GEQ (Greater Than or Equal)**, **LEQ**, and **EQU** allow analog-to-digital converted values (tank level, temperature, pressure) to be compared against setpoints within ladder rungs.
## The Duplicate Output Coil Problem
One of the most important rules in ladder diagram programming: you cannot have two OTE coils with the same address in the same program task. On each scan, the last rung wins — the first OTE rung's result is overwritten by the second. This bug is hard to find because the first rung appears to be doing nothing. The fix is to use the OR logic within a single rung, or use OTL/OTU latch pairs instead. Most PLC programming software (TIA Portal, Studio 5000) have cross-reference tools that flag duplicate output coils.
## Ladder Diagram vs Relay Schematic: Side by Side
The ladder diagram rung `--[XIC Start]--[XIC Seal-in]--[XIO Stop]--[XIO OL]--( Motor )--` maps exactly to a relay schematic where the start pushbutton (NO), an auxiliary contact of the motor contactor (NO, for seal-in), the stop pushbutton (NC), and the overload relay contact (NC) are all wired in series between the live conductor and the contactor coil. The PLC version replaces hardwired copper with software logic, but the visual language is intentionally identical so that an electrician reading either document reaches the same understanding.
## PLC Brands and Notation Differences
Ladder logic is standardised by IEC 61131-3 and PLCopen, meaning the same logical structure works across all major platforms, though symbol names and address formats differ. Allen-Bradley (Studio 5000 / RSLogix 500) uses XIC/XIO/OTE and addresses like I:0/0 and O:0/0 for discrete I/O. Siemens TIA Portal uses the same graphical symbols but calls the language LAD and uses addresses like I0.0 and Q0.0, with CALL instructions for function blocks. Omron CX-Programmer uses 0.00 for inputs and 100.00 for outputs. Schneider Electric EcoStruxure uses %I0.1 and %Q0.1. These are syntactic differences only — the logic structure is identical and any competent programmer can migrate between platforms.
## Industrial Applications
Ladder diagrams are used in virtually every sector of manufacturing and process control: automotive assembly (stamping presses, robotic cell interlocks), food and beverage (filling, capping, pasteurisation sequences), water and wastewater treatment (pump station control, dosing), oil and gas (wellhead safety shutdown systems), HVAC (fan and pump scheduling), and conveyor and material handling. The language's readability by both programmers and maintenance electricians makes it the default choice for any application where shop-floor technicians need to troubleshoot live without a programming laptop.
Draw and simulate your own ladder diagrams instantly in circuitdiagrammaker — the free browser-based ladder editor requires no download and exports clean SVG or PDF for panel documentation and project reports.
How to wire ladder diagram
- Define your I/O allocation table Before writing a single rung, list every physical input (sensors, pushbuttons, limit switches) and every physical output (contactors, valves, lights) with its PLC address (e.g. I:0/0 or I0.0), tag name, and signal type (NO/NC). This table is the foundation of every correct ladder program.
- Identify output conditions (what must be TRUE for each output to energise) For each output, write the boolean expression in plain language: 'Motor runs IF Start pressed OR Motor already running, AND Stop not pressed AND Overload not tripped.' This prose becomes your rung structure.
- Draw the power rails Place the left power rail (logical live) and right power rail (logical neutral) on your diagram. Every rung will connect between these two rails.
- Add contacts for series AND conditions Place XIC (NO) contacts in series from left to right for each condition that must be TRUE simultaneously. Use XIO (NC) contacts for conditions that must be FALSE (e.g., Stop button not pressed, E-stop not activated).
- Add parallel branches for OR conditions For conditions where any one of several inputs can energise the output, draw parallel branches — each branch connecting at the same left and right junction on the rung. The seal-in contact (parallel to Start) is the most common example.
- Place the output coil At the right end of each rung, place the OTE coil for the output being controlled. Never place two OTE coils with the same address — use OTL/OTU pairs or restructure the logic into one rung if multiple conditions must control the same output.
- Add timer and counter rungs For time-delayed actions, add a TON or TOF instruction block on the rung that enables it. Add a separate rung downstream that uses the timer's DN (Done) bit as an XIC contact to trigger the timed output.
- Simulate and verify before downloading Use the software's offline simulation or a free tool like OpenPLC to step through the logic. Force individual inputs to test every path: confirm start/stop, verify interlocks prevent simultaneous outputs, and check timer/counter behaviour.
Specifications
| -| |- | XIC — Examine If Closed (NO contact). TRUE when associated bit = 1. |
|---|---|
| -|/|- | XIO — Examine If Open (NC contact). TRUE when associated bit = 0. |
| -( )- | OTE — Output Energize coil. Sets bit to 1 while rung is TRUE; 0 when FALSE. Non-retentive. |
| -(L)- | OTL — Output Latch (SET). Sets bit to 1 when rung TRUE; retains 1 when rung goes FALSE. |
| -(U)- | OTU — Output Unlatch (RESET). Clears bit to 0 when rung TRUE. |
| TON | Timer On Delay. Accumulates time while enable rung TRUE. DN bit sets when ACC ≥ PRE. Resets ACC when rung goes FALSE. |
| TOF | Timer Off Delay. DN bit ON immediately when rung TRUE. Starts timing when rung goes FALSE; clears DN when ACC ≥ PRE. |
| RTO | Retentive Timer On. Accumulates time while rung TRUE; retains ACC when rung goes FALSE. Requires RES instruction to clear. |
| CTU | Count Up. Increments ACC on each FALSE-to-TRUE rung transition. DN sets when ACC ≥ PRE. |
| CTD | Count Down. Decrements ACC on each FALSE-to-TRUE rung transition. DN sets when ACC ≤ 0. |
| -|P|- | ONS / OSR — One-Shot Rising. TRUE for exactly one scan on a FALSE-to-TRUE input transition. Prevents repeated triggering. |
| GEQ | Greater Than or Equal. TRUE when Source A ≥ Source B. Used for analog threshold comparisons. |
| EQU | Equal. TRUE when Source A = Source B. |
| ADD / SUB / MUL / DIV | Math instructions. Perform arithmetic on integer or floating-point data table values when rung is TRUE. |
| RES | Reset. Clears the accumulated value (ACC) of a timer (RTO) or counter (CTU/CTD) when rung goes TRUE. |
Safety warnings
- Always wire E-stop and Stop buttons as normally-closed (NC) contacts at the hardware level AND represent them as XIO contacts in the ladder diagram. A broken field wire will open the NC contact, de-energising the output — the machine-safe condition. An NO wired Stop button that breaks will leave the machine running with no way to stop it.
- Never rely solely on PLC software logic for safety-critical functions (Category 2 and above per ISO 13849). E-stops and guard interlocks on safety-rated applications must be routed through certified safety relays or safety PLCs with hardware-enforced logic, not standard OTE coils.
- Duplicate output coils can cause a machine to operate in an unexpected state. Before commissioning any program change, run the software's duplicate output report and resolve all conflicts.
- During live online editing, understand that changes take effect at the end of the current scan — outputs may change state unexpectedly. Always put the machine in a known safe state before making online edits.
Tools needed
- PLC programming software: Allen-Bradley Studio 5000 or RSLogix 500, Siemens TIA Portal, Omron Sysmac Studio, or the free OpenPLC IDE for learning and simulation.
- circuitdiagrammaker.com — free browser-based ladder diagram editor for drawing, annotating, and exporting ladder diagrams as SVG or PDF without installing any software.
- PLC hardware or a simulation environment (PLCSIM in TIA Portal, RSLogix Emulate for Allen-Bradley) for testing logic before deployment.
- Multimeter and laptop with USB/Ethernet connectivity for commissioning — required to verify physical I/O wiring matches the I/O allocation table.
- I/O allocation table (spreadsheet) listing every tag name, PLC address, signal type, and field device description.
Common mistakes
- Duplicate OTE coils with the same address — the last rung always wins, silently overwriting the first. Use the cross-reference report to detect this. Fix by combining conditions into one rung or using OTL/OTU pairs.
- Wiring the Stop button as normally-open (NO) instead of normally-closed (NC). A NO Stop button means the machine cannot be stopped if the wire breaks or the button fails — this violates fail-safe wiring principles and most safety standards.
- Forgetting the seal-in contact on the Start rung — the output only stays ON while the Start button is held, not what the operator expects for a motor circuit.
- Placing too many outputs in a single rung without clearly documenting the logic — ladder rungs should be short and self-describing. One output per rung is best practice; complex multi-output rungs become impossible to debug.
- Not accounting for scan-time effects on fast signals — a proximity sensor pulsing at 50 Hz cannot be reliably read by a 20 ms scan cycle PLC without one-shot detection or a hardware interrupt.
- Using the same timer address in multiple rungs — timers are single-instance objects; two rungs both controlling T4:0 will fight each other on every scan.
Troubleshooting
- Rung appears TRUE in online monitoring but output does not energise
- Cause: The physical output module may be faulted, the field wiring may be open, or the output is inhibited by a separate safety relay circuit. Fix: Force the output bit to 1 in the data table. If the field device still does not energise, the fault is in the hardware, not the ladder program. Check output module status LEDs, fuse state, and field wiring continuity.
- Motor starts by itself when PLC is powered on
- Cause: The seal-in rung is inadvertently TRUE on power-up — possibly because a bit retained its state from the previous power cycle, or a start condition is already active. Fix: Add a 'first-scan' rung that clears all output latches using OTU instructions on the first program scan. In Studio 5000, use the S:1/15 (first scan) bit; in TIA Portal use the StartupOK system bit.
- Timer never reaches done (DN bit never sets)
- Cause: The enable rung is intermittent — a contact flickers FALSE before ACC reaches PRE, resetting the TON accumulator. Or the preset value is in wrong time base units. Fix: Monitor the timer's EN, TT, and DN bits in real time. Verify the rung stays continuously TRUE during the intended delay. Check that PRE is entered in milliseconds (most modern PLCs) not tenths-of-seconds.
- Counter count-up is erratic — increments multiple times per part
- Cause: The sensor contact is bouncing, or the sensor dwell time spans multiple scans, causing multiple FALSE-to-TRUE transitions per physical object. Fix: Add an ONS (one-shot) instruction in series with the counter enable contact. The ONS fires for exactly one scan per transition, regardless of how many scans the input remains TRUE.
Frequently asked questions
What is a ladder diagram in a PLC?
A ladder diagram (LD) is a graphical PLC programming language defined by IEC 61131-3 that represents control logic as horizontal rungs between two vertical power rails. Contacts on each rung are boolean conditions (inputs), and the output coil at the right is energised when the rung evaluates TRUE. It is the most widely used PLC language worldwide because it mirrors traditional relay-logic wiring schematics.
What is the difference between a ladder diagram and a wiring diagram?
A wiring diagram shows the physical conductors, terminal numbers, and actual component locations in a panel — it is used to build and wire hardware. A ladder diagram shows the logical control program — what conditions must be met for each output to activate. The same machine will have both: a wiring diagram for the panel builder and a ladder diagram for the PLC programmer.
What are the five basic instructions in ladder logic?
The five core instructions are: XIC (Examine If Closed / normally-open contact), XIO (Examine If Open / normally-closed contact), OTE (Output Energize coil), OTL (Output Latch / SET coil), and OTU (Output Unlatch / RESET coil). Everything else — timers, counters, comparison instructions — builds on these fundamentals.
What is the difference between NO and NC contacts in a ladder diagram?
An NO (normally open) contact — XIC in Allen-Bradley, -| |- symbol — passes current when its associated bit is 1 (the physical device is activated or closed). An NC (normally closed) contact — XIO, -|/|- symbol — passes current when its associated bit is 0 (the physical device is at rest or open). Stop buttons and E-stops are always wired as NC contacts for fail-safe operation: a wire break or power loss opens the circuit and stops the machine.
What is a seal-in contact and why is it used?
A seal-in (or hold-in) contact is a normally-open contact wired in parallel with the Start pushbutton and controlled by the output coil itself. When the Start button is pressed and the output energises, the output's own contact closes and maintains the rung TRUE even after the momentary Start button is released. This is how a momentary pushbutton latches an output — without a seal-in contact, the output would only stay ON while the Start button is held.
How fast does a PLC scan a ladder program?
A typical PLC scan cycle is 1–20 milliseconds depending on program size and processor speed. Small programs on modern PLCs scan in under 1 ms; very large programs with many function blocks may take 20–50 ms. The scan time determines the minimum reliable input pulse width — signals shorter than one scan time may be missed. One-shot (ONS/OSR) instructions or hardware interrupt routines are used for very fast signals.
Can I have more than one output coil with the same address?
No — this is one of the most dangerous mistakes in ladder programming. If two OTE coils share the same address, only the last one scanned determines the bit state; the first is overwritten every scan. This can cause an output to appear dead even though one rung is energising it. Most modern PLC software flags duplicate output coils in a cross-reference report. Use OTL/OTU latch pairs or combine the conditions into a single rung to avoid this.
What is the difference between OTE, OTL, and OTU coils?
OTE (Output Energize) is non-retentive: the bit is 1 while the rung is TRUE and 0 when the rung is FALSE. OTL (Output Latch / SET) sets the bit to 1 when the rung goes TRUE and the bit stays 1 even when the rung goes FALSE. OTU (Output Unlatch / RESET) clears the bit to 0 when its rung goes TRUE. OTL and OTU always work as a pair controlling the same address — OTL latches it on, OTU latches it off.
Which PLC brands use ladder diagram programming?
All major PLC platforms support ladder diagrams: Allen-Bradley (Studio 5000 / RSLogix 500 / RSLogix 5000), Siemens (TIA Portal — called LAD), Omron (CX-Programmer / Sysmac Studio), Schneider Electric (EcoStruxure Control Expert), Mitsubishi (GX Works), Delta, Beckhoff (TwinCAT), and the open-source OpenPLC. The IEC 61131-3 standard ensures logical compatibility across platforms, though address formats and instruction names differ slightly.
Is ladder logic still relevant in 2026?
Absolutely. Despite the growth of Structured Text and Function Block Diagram for complex algorithms, ladder logic remains the dominant language in discrete manufacturing, material handling, and machine control. Its readability by both programmers and maintenance electricians — who do not necessarily code — makes it irreplaceable in plant-floor environments. IEC 61131-3 ensures it will remain a formal standard for the foreseeable future.