Skip to content

Blog / How to Read Ladder Logic

PLC Programming — Allen-Bradley Ladder Logic

How to Read Ladder Logic

Ladder logic is a PLC programming language that represents electrical relay circuits as horizontal rungs on a ladder. Each rung has inputs on the left (conditions) and outputs on the right (actions). When all input conditions are true, the output energizes. That's the entire mental model — everything else is variations on this.

Key Takeaways
  • Ladder logic reads left to right: inputs (contacts) on the left, outputs (coils) on the right.
  • A rung executes when all its input conditions are simultaneously true.
  • XIC (Examine If Closed) = normally open contact. XIO (Examine If Open) = normally closed contact.
  • Timers (TON, TOF, RTO) and counters (CTU, CTD) are the most common non-contact instructions.
  • You can view Allen-Bradley ladder logic in your browser without Studio 5000 using plc.company.

What Is a Ladder Logic Rung?

A rung is one logical statement in ladder logic. Think of it like a sentence: if the conditions on the left are all true, then execute the action on the right. The rung reads from left to right, with the left side containing input conditions (contacts) and the right side containing the output (coil).

On both the far left and far right of the rung is a vertical line called the power rail. Power flows down the left rail, through the contacts (inputs), and if all conditions allow it, power reaches the coil (output) on the right. The coil then energizes, sending power back down the right rail to complete the circuit.

There are only two types of basic contacts: XIC (Examine If Closed) and XIO (Examine If Open). Every complex piece of ladder logic is built from combinations of these two instructions, plus specialized instructions like timers and counters.

What Do Contacts and Coils Mean?

Contacts and coils are the fundamental building blocks of ladder logic. Understanding these four instructions unlocks 80% of what you'll encounter in real programs.

  • XIC (Examine If Closed) — Also called a normally open contact. The rung condition is true (allows power to flow) when the tag bit is 1. Think of it as a switch that must be pressed to allow power through. Used when you want to execute an action only when a condition is ON.
  • XIO (Examine If Open) — Also called a normally closed contact. The rung condition is true when the tag bit is 0. It's the opposite of XIC: power flows when the condition is OFF. Used for safety interlocks and to prevent actions under certain conditions.
  • OTE (Output Energize) — Sets a bit to 1 when the rung conditions are true. When the rung becomes false, the bit is cleared to 0. It's the most common output instruction. Every output energize coil on the right side of a rung is an OTE.
  • OTL / OTU (Latch / Unlatch) — OTL sets a bit to 1 and keeps it there (latches) even if the rung condition becomes false. OTU clears the bit back to 0. Used together to create "toggle" behavior or to hold a state across scan cycles.

How Do Timers Work in Ladder Logic?

Timers are specialized instructions that measure elapsed time. They count up (or down) at a fixed rate and trigger outputs when specific time thresholds are crossed. There are three main timer types in Allen-Bradley ladder logic.

  • TON (Timer On Delay) — Starts counting when the rung goes true. After the preset time has elapsed, the DN (done) bit sets to 1. When the rung goes false, the timer resets to zero. Use this for "wait 5 seconds then turn on the alarm" scenarios.
  • TOF (Timer Off Delay) — Waits for the rung to go false, then counts down. Useful for gradual shutdowns or to delay turning something off after a trigger condition is removed.
  • RTO (Retentive Timer) — Accumulates time even if the rung goes false. The accumulated time persists across scan cycles and power cycles until explicitly reset. Used for total uptime tracking and duty cycle monitoring.

Every timer has associated data: PRE (preset time in milliseconds), ACC (accumulated time so far), EN (enabled — true while timing), DN (done — true when ACC ≥ PRE), and TT (timing — true while actively counting).

How Do Counters Work?

Counters increment or decrement based on rung transitions and trigger outputs when thresholds are met. They're commonly used to count production cycles, failed attempts, or state changes.

  • CTU (Count Up) — Increments by 1 each time the rung transitions from false to true. When ACC (accumulated) equals PRE (preset), the DN (done) bit sets to 1. Used to count upward to a limit.
  • CTD (Count Down) — Decrements by 1 each time the rung transitions from false to true. Often paired with CTU in the same program to allow counting up and down on different transitions.
  • RES (Reset) — Clears a counter's accumulated value back to 0 and resets the DN bit to 0. Essential for preparing a counter for the next counting cycle.

What Is Branching in Ladder Logic?

Branching allows you to build complex logical conditions by combining contacts in series and parallel arrangements.

Series contacts (left to right on the same line) represent AND logic — all contacts must be true for power to flow. If ANY contact is false, the entire rung is false and the output does not energize.

Parallel branches (stacked vertically) represent OR logic — if ANY branch is true, power can flow through. A parallel branch is true if all its series contacts are true. Multiple true branches feed the same output.

You can nest branches within branches to create very complex conditions. Always read nested structures from the innermost (top) level outward. The visual layout mirrors the logical structure, making ladder logic readable once you understand this principle.

How Do You Read Allen-Bradley Ladder Logic Specifically?

Modern Allen-Bradley controllers (ControlLogix, CompactLogix, GuardLogix) use Studio 5000 and employ tag-based addressing. This is different from older SLC 500 controllers, which used file-based addressing like B3:0/0.

In tag-based addressing, you assign human-readable names to data values. Instead of "Check if bit 3 of data file B is set," you check "Is the emergency_stop tag true?" This makes ladder logic far more readable because the names have meaning.

Tags can be controller-scoped (visible to all programs) or program-scoped (visible only within a single program). When reading a ladder rung, always note which scope a tag belongs to — this affects where you can find it being used elsewhere.

Pro tip: Use the cross-reference feature in Studio 5000 (or the tag cross-reference tool in PLC Company) to see every rung that reads or writes a specific tag. This instantly shows you all the places where a signal is used, making it easy to trace logic flow across the entire program.

Try it on a real program

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

How to Read Ladder Logic Without Studio 5000

You don't need a $1,300+ Studio 5000 license just to view and understand someone else's PLC program. Upload your ACD file (ControlLogix/CompactLogix export) or L5X file (Studio 5000 XML format) to PLC Company, and the viewer displays every rung exactly as it appears in Studio 5000.

The PLC Company viewer lets you click any rung to get a plain-English AI explanation of what it does. You can also cross-reference tags, view the complete tag database, trace signals, and export documentation — all in your browser.

This is especially valuable when learning, troubleshooting, or auditing code written by someone else. You can review the complete program logic without licensing or installation overhead.

See It On Your Own Program

Upload an ACD or L5X file and browse real ladder logic in your browser — no Studio 5000 needed

Drop your ACD or L5X file here

or browse to select

.ACD.L5X

Frequently Asked Questions

  • What is the difference between XIC and XIO?

    XIC (Examine If Closed) is true when the tag bit is 1 — it acts like a normally open relay contact. XIO (Examine If Open) is true when the tag bit is 0 — it acts like a normally closed relay contact. In a rung, XIC means "only execute if this condition is ON," and XIO means "only execute if this condition is OFF."

  • How do you read a ladder logic diagram for beginners?

    Start from the left side of each rung — these are your input conditions (contacts). Read left to right. If all the input conditions are simultaneously true, the output on the right (coil) energizes. Inputs in series = AND logic (all must be true). Inputs in parallel branches = OR logic (any can be true). This is the fundamental pattern repeated throughout ladder logic.

  • What does a normally open contact mean in ladder logic?

    A normally open contact represents a condition that is false by default. In ladder logic, the XIC instruction is used for this. The rung executes only when that contact is closed (the bit is 1). Think of it like a switch that must be held down — by default it's not pressed, but when you press it, power flows.

  • How do you trace a signal through ladder logic?

    Start with a known input tag or signal. Look at which rungs reference that tag as an input (via XIC or XIO). See what outputs those rungs produce. Then trace those output tags forward to any rungs that use them as inputs. Use the cross-reference tool (available in Studio 5000 and PLC Company) to see every place a tag is used throughout the entire program. This builds a complete picture of the signal flow.

  • Can I view ladder logic without Studio 5000?

    Yes. Upload your ACD project file, L5X export, or RSS file to PLC Company. The viewer displays ladder logic exactly as it appears in Studio 5000, without requiring expensive software. You can also view tag definitions, trace signals, and export documentation — all in your browser at a fraction of the cost of buying Studio 5000.

Ready to View Your PLC Programs?

Upload your ACD, L5X, or RSS file to explore ladder logic in your browser.

or view an example →