Skip to content

Blog/What Is Ladder Logic?

PLC Programming — Ladder Logic Fundamentals

What Is Ladder Logic?

Ladder logic is a graphical PLC programming language that represents industrial control circuits as a series of horizontal rungs. Each rung has input conditions (contacts) on the left and output actions (coils) on the right. When all input conditions are satisfied, the rung is true and the output activates. It was designed to look like the relay logic diagrams electricians already knew.

Key Takeaways
  • Ladder logic is one of five IEC 61131-3 PLC programming languages — the most widely used.
  • Each rung is an independent logical statement: left side = conditions, right side = action.
  • Contacts are inputs (XIC/XIO). Coils are outputs (OTE, OTL, OTU).
  • Allen-Bradley Studio 5000 uses tag-based ladder logic — named variables instead of addresses.
  • You can view any Allen-Bradley ladder logic program in your browser at plc.company.

Why Does Ladder Logic Look Like a Ladder?

Ladder logic was invented in the 1970s as a replacement for physical relay panels. Before PLCs, factories controlled equipment using thousands of relays wired together. Electricians designed these circuits on diagrams that looked like a ladder: vertical rails on the left and right (the power rails), with horizontal rungs representing the control logic between them.

When the first PLCs arrived, engineers realized they could make them display the same visual format. This was brilliant because electricians already understood how to read these diagrams. There was no learning curve. Power flowed down the left rail, through the contacts (switches), and if the conditions were met, it energized the coil (output) on the right.

This design decision has been so successful that ladder logic is still the dominant PLC programming language 50 years later. It's easy to read, easy to troubleshoot, and intuitive for anyone with an electronics background.

How Does Ladder Logic Work?

Understanding ladder logic requires understanding the PLC scan cycle. Here's how it works:

  1. Read inputs

    The PLC reads all physical input signals (buttons, sensors, limit switches) and stores them in memory as tag values (BOOL variables, typically 0 or 1).

  2. Execute logic

    The PLC scans every rung of ladder logic from top to bottom, left to right. For each rung, it evaluates all the input conditions. If they are all true, the output (coil) executes and the corresponding output tag changes state.

  3. Write outputs

    After all rungs are executed, the PLC writes all output tag values to the physical output hardware (motors, lights, solenoids).

  4. Repeat

    The cycle repeats continuously. On a typical PLC, this happens 10–50 times per second depending on the program size and configuration.

This predictable scan cycle is why ladder logic works reliably in industrial settings. Every decision is made the same way, every cycle, with no ambiguity.

What Are Contacts and Coils?

Ladder logic has two basic building blocks: contacts and coils. You must understand these to read any program.

XIC (Examine If Closed) — Normally Open Contact

XIC checks if a tag bit is 1 (true/on). It's true when the condition is met. In the ladder diagram, it's drawn as a pair of parallel vertical lines. Think of it like a switch you must press to close — by default it's open, but when you press it, power flows through.

XIO (Examine If Open) — Normally Closed Contact

XIO checks if a tag bit is 0 (false/off). It's true when the condition is NOT met. In the ladder diagram, it's drawn as two parallel lines with a diagonal slash through them. Think of it like a switch held down — it's normally closed, but when you press it, it opens and stops power flow.

OTE (Output Energize) — Output Coil

OTE turns a tag bit ON when all input conditions are true. It's drawn as a circle. This is the action that happens when the rung is satisfied. When the rung is false, the output turns off.

OTL (Output Latch) — Latching Coil

OTL turns a tag bit ON and keeps it ON even after the input conditions become false. It's drawn as a circle with an "L" inside. The only way to turn it off is with OTU (Output Unlatch).

OTU (Output Unlatch) — Unlatching Coil

OTU turns a tag bit OFF. It's drawn as a circle with a "U" inside. Used to reset latched outputs.

These five instructions form the foundation of all ladder logic. Everything else (timers, counters, comparisons) are built on top of these basic concepts.

What Other Instructions Are in Ladder Logic?

Beyond basic contacts and coils, ladder logic includes many more instructions:

Timers (TON, TOF, RTO)

TON (Timer ON) starts a timer when the input becomes true and counts up. When it reaches the preset value, the timer output bit energizes. TOF (Timer OFF) counts down when the input becomes false. RTO (Retentive Timer) keeps its accumulated time even after power loss.

Counters (CTU, CTD, RES)

CTU (Count Up) increments a counter each time the input transitions from false to true. CTD (Count Down) decrements. RES (Reset) resets the counter to zero. Counters are used for counting discrete events like items on a conveyor or machine cycles.

Comparisons (GRT, LES, EQU, NEQ)

GRT tests if one value is greater than another. LES tests if less than. EQU tests if equal. NEQ tests if not equal. These are used for conditional branching based on numeric values.

Math (ADD, SUB, MUL, DIV)

Basic arithmetic operations. ADD adds two numbers. SUB subtracts. MUL multiplies. DIV divides. The result is stored in a destination tag.

Move (MOV, COP)

MOV copies a value from one tag to another. COP copies entire arrays. Used for data manipulation and signal routing.

The key point: ladder logic can do far more than basic relay logic. It's a complete programming language that can perform calculations, make decisions, and control complex sequences. But the syntax and visual format remain graphical and intuitive.

Is Ladder Logic Used in Allen-Bradley PLCs?

Yes. Allen-Bradley Studio 5000 Logix Designer supports ladder logic as the primary programming language for ControlLogix and CompactLogix controllers. These are the most common industrial PLCs in North America.

Allen-Bradley uses tag-based ladder logic, meaning you create named variables (tags) instead of using numeric addresses. For example, instead of addressing an input as "I:1/0", you create a tag called "StartButton" or "PumpRunning". This makes the code much more readable and maintainable.

Studio 5000 also supports other languages — Structured Text (similar to traditional programming) and Function Block Diagram (graphical, block-based). But ladder logic remains the most common and the first language you should learn for Allen-Bradley systems.

See real Allen-Bradley ladder logic

Upload an ACD or L5X file to plc.company. Every rung is displayed in your browser exactly as it appears in Studio 5000. Click any rung to get a plain-English explanation.

How Do I Start Reading Ladder Logic?

Now that you understand the basic concepts, here's how to read your first rung:

  1. Start from the top rung

    PLCs execute rungs from top to bottom. Find the topmost rung and work your way down.

  2. Read left to right

    On each rung, start from the left power rail and read toward the right. Identify all the input contacts (conditions).

  3. Identify the condition logic

    Are the contacts in series (all must be true) or in parallel (any can be true)? Series contacts are written one after another. Parallel contacts are stacked vertically.

  4. Find the output on the right

    At the right end of the rung is the output (coil). This is what happens when the input conditions are satisfied.

  5. Understand what the tag names mean

    In real programs, tag names are descriptive: "StartButton", "PumpMotor", "HighTemperatureAlarm". The names tell you what the logic is controlling.

  6. Trace the signal flow

    Use Studio 5000's cross-reference feature or plc.company's tag viewer to see where each tag is used throughout the program. This shows you the complete flow of control.

For a complete walkthrough with examples, see our guide How to Read Ladder Logic.

View Ladder Logic Without Software

The biggest barrier to learning ladder logic is that you need expensive software to view it. Studio 5000 costs $1,300–$7,000.

You can work around this by uploading your ACD or L5X files to plc.company. The browser-based viewer displays ladder logic exactly as it appears in Studio 5000, without any software required. Click individual rungs to see plain-English explanations of what each instruction does. Use the tag cross-reference tool to trace signal flow through the entire program.

This is the fastest way to learn ladder logic — by reading actual production code from real plants, not example programs from textbooks.

View Real Ladder Logic Now

Upload any Allen-Bradley ACD or L5X file — no Studio 5000 license required

Drop your ACD or L5X file here

or browse to select

.ACD.L5X

Frequently Asked Questions

What is ladder logic used for?

Ladder logic is used to program industrial PLCs (programmable logic controllers) that control factories, assembly lines, pumps, motors, conveyor systems, and other industrial equipment. It is the dominant programming language in North American manufacturing.

Is ladder logic easy to learn?

Yes, if you understand the fundamentals. The core concept is simple: inputs on the left, outputs on the right, execute when all conditions are true. It becomes harder when programs get large and complex, but the basic syntax is easier than traditional programming languages.

What is the difference between ladder logic and regular programming?

Ladder logic is graphical and designed to mimic relay circuits. Regular programming (like Python or C) is text-based and more abstract. Ladder logic runs in a fixed scan cycle (read inputs, execute logic, write outputs), while regular programs have more flexible execution models.

Do all PLCs use ladder logic?

No. The IEC 61131-3 standard defines five PLC programming languages: ladder logic, structured text, function block diagram, instruction list, and sequential function chart. However, ladder logic is the most widely used and the first language you should learn.

How do I view ladder logic without software?

Upload your ACD or L5X file to plc.company. The viewer displays ladder logic in your browser without requiring any software license. You can click individual rungs to see explanations, view tag definitions, and trace signal flow.

Start Reading Real Ladder Logic

Upload your first ACD or L5X file to plc.company and click rungs to see AI explanations.