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.