PLC Ladder Logic Tutorial – 7 Real Examples + Complete Symbol Guide (2026)

Last Updated: April 2026 | Written for automation engineers and beginners learning PLC programming.

PLC ladder logic is the most widely used programming language in industrial automation. Whether you are a beginner starting your automation journey or an experienced engineer looking to solidify your fundamentals, this tutorial covers everything you need to know — from basic symbols to real industrial examples.

In this guide you will find:

  • Every ladder logic symbol explained clearly with real usage examples
  • 7 complete ladder logic examples from real industrial applications
  • How ladder logic works in Siemens TIA Portal and Rockwell Studio 5000
  • The most common mistakes engineers make and how to avoid them
  • A full comparison of ladder logic vs other PLC programming languages

⚡ Master Ladder Logic with Hands-On Exercises

Want to practice ladder logic with structured video lessons? The Ladder Logic PLC Programming for Beginners course on Udemy walks you through 25 hands-on examples and exercises — covering boolean logic, timers, counters, math operations, and finite state machines. Includes a free Ladder Logic Cheat Sheet bonus. Works with any PLC brand or simulator.

Disclosure: This is an affiliate link. We may earn a small commission at no extra cost to you, which helps support this free educational content.


What is PLC Ladder Logic?

Ladder logic (also called Ladder Diagram or LD) is a graphical programming language used to program Programmable Logic Controllers (PLCs). It represents control logic using symbols that resemble electrical relay circuits — with two vertical rails (power lines) and horizontal rungs connecting them, just like a physical ladder.

The name comes from the visual layout: each horizontal line of logic is called a rung, and multiple rungs stacked vertically form what looks like a ladder.

Ladder logic was originally developed to help electricians and technicians transition from hardwired relay panels to programmable controllers. Because it looks like a relay circuit diagram, anyone familiar with electrical schematics can read and understand it without needing traditional programming experience.

Today, ladder logic follows the international IEC 61131-3 standard, which defines programming languages for all PLC systems globally. It is supported by virtually every PLC manufacturer including Siemens, Allen-Bradley, Mitsubishi, Omron, and Schneider Electric.

Before writing ladder logic, make sure you understand how PLC inputs and outputs work — ladder logic directly controls these field signals.


How Ladder Logic Works — The PLC Scan Cycle

Understanding how the PLC executes ladder logic is essential before writing your first program. The PLC does not run all rungs simultaneously — it processes them one at a time, top to bottom, in a repeating cycle called the scan cycle.

Each scan cycle has 4 stages:

StageWhat HappensDuration
1. Input ScanPLC reads all physical input signals (sensors, switches)~1ms
2. Program ExecutionPLC executes all ladder logic rungs top to bottom~1–10ms
3. Output ScanPLC writes all output states to physical devices~1ms
4. HousekeepingCommunication, diagnostics, memory management~1ms

The entire scan cycle typically completes in 1–20 milliseconds, repeating continuously while the PLC is in RUN mode. This is fast enough to respond to virtually any industrial process in real time.

Key rule: Each rung is evaluated left to right. If all input conditions on the left side of a rung are TRUE, the output on the right side is energized.


PLC Ladder Logic Symbols — Complete Reference

PLC ladder logic symbols complete reference NO NC coil timer counter]

Every ladder logic program is built from a set of standard symbols. Here is every symbol you need to know:

1. Normally Open Contact (NO) — XIC

Symbol: --[ ]--    Rockwell: XIC    Siemens: –| |–

A Normally Open contact passes current (evaluates TRUE) when the associated input signal is ON (active). When the input is OFF, no current passes.

Used for: Start push buttons, sensor signals, run feedback contacts, permissive conditions

Real example: Start push button — when pressed (ON), current flows through the rung and the motor output energizes.

2. Normally Closed Contact (NC) — XIO

Symbol: --[/]--    Rockwell: XIO    Siemens: –|/|–

A Normally Closed contact passes current (evaluates TRUE) when the associated input signal is OFF (inactive). When the input turns ON, current stops — it blocks the rung.

Used for: Stop push buttons, emergency stops, safety interlocks, overload trips

Critical safety rule: Always use NC contacts for stop buttons and emergency stops. If the cable breaks, the NC contact opens and stops the machine — this is fail-safe behaviour.

3. Output Coil — OTE

Symbol: --( )--    Rockwell: OTE    Siemens: –( )–

The Output Coil energizes a physical output device when all input conditions on the rung are TRUE. It de-energizes immediately when any input condition becomes FALSE.

Used for: Motor contactors, solenoid valves, alarm lamps, pilot lights, relay coils

4. Set Coil (Latch) — OTL

Symbol: --(S)--    Rockwell: OTL    Siemens: –(S)–

The Set coil latches an output ON and keeps it ON even after the input condition goes FALSE. It stays ON until a Reset (OTU/R) coil on a separate rung clears it.

Used for: Alarm latching, step sequencers, mode selection, batch start/stop

5. Reset Coil (Unlatch) — OTU

Symbol: --(R)--    Rockwell: OTU    Siemens: –(R)–

The Reset coil clears (turns OFF) a latched output that was previously set by a Set coil.

Used for: Alarm reset, batch stop, mode reset, step sequence return to start

6. TON Timer (On-Delay)

Symbol: Timer block    Rockwell: TON    Siemens: TON

The TON timer starts counting when the input condition becomes TRUE. After the preset time (PT) is reached, the timer output (Q) turns ON. If the input goes FALSE before the timer completes, it resets.

Used for: Motor start delays, alarm delays, heating cycle timing, conveyor dwell time

7. TOF Timer (Off-Delay)

The TOF timer output turns ON immediately when the input goes TRUE. When the input goes FALSE, the timer starts counting — the output stays ON for the preset time then turns OFF.

Used for: Motor run-on after stop, cooling fan delays, lubrication systems

8. CTU Counter (Count Up)

Symbol: Counter block    Rockwell: CTU    Siemens: CTU

The CTU counter increments its accumulated value (ACC) by 1 each time the input has a rising edge (OFF to ON transition). When ACC reaches the preset value (PV), the counter output (Q/DN) turns ON.

Used for: Product counting, batch control, cycle counting, maintenance scheduling


7 PLC Ladder Logic Examples

These are the most common and important ladder logic examples used in real industrial automation systems. Each example explains the logic, the rungs, and the real-world application.

Example 1 – Motor Start/Stop with Seal-In Contact

This is the most fundamental ladder logic program in industrial automation. It appears in virtually every factory that uses PLCs. Understanding this rung is the foundation of all ladder logic programming.

IO Used:

TagTypeAddressDescription
START_PBDII0.0Start push button (NO contact)
STOP_PBDII0.1Stop push button (NC contact)
MTR_RUNDOQ0.0Motor contactor output

Rung 1 – Start/Stop Logic:

|--[START_PB]--+--[MTR_RUN]--[STOP_PB NC]--[E_STOP NC]--(MTR_RUN)--|
               |                                                      |
               +--[MTR_RUN]--+                                        |

How it works:

  • When START_PB is pressed → current flows → MTR_RUN output energizes → motor starts
  • MTR_RUN contact (seal-in) closes in parallel with START_PB → motor keeps running after button released
  • When STOP_PB is pressed → NC contact opens → rung goes FALSE → motor stops
  • If E_STOP activates → NC contact opens → motor stops immediately

💡 Engineering Note: The seal-in contact (also called a holding contact or latch) is one of the most important concepts in ladder logic. Without it, the motor would only run while the start button is held down. The seal-in keeps the circuit energized after the momentary button press is released.


Example 2 – TON Timer (Delayed Motor Start)

A 5-second delayed motor start — used in systems where a warning horn or light must sound before a machine starts. Common in conveyors, crushers, and processing equipment.

TagTypeAddressDescription
START_PBDII0.0Start push button
TIMER_T1InternalT1TON timer, preset 5 seconds
HORNDOQ0.1Warning horn output
MTR_RUNDOQ0.0Motor contactor output

Rung 1: START_PB (NO) → TON Timer T1 (PT=5s)

Rung 2: START_PB (NO) → HORN output (warning sounds immediately)

Rung 3: T1.Q (timer done bit, NO) → MTR_RUN output (motor starts after 5s)

How it works: Start button pressed → horn sounds immediately → after 5 seconds → timer output goes TRUE → motor starts. This gives workers time to clear the area before the machine starts.


Example 3 – Conveyor with Product Detection

A conveyor that runs when a product is detected by a sensor and stops automatically when the product reaches the end position. Used in packaging, sorting, and material handling systems.

TagTypeAddressDescription
PHOTO_SENSDII0.0Photoelectric sensor (product detected)
END_LIMITDII0.1End position limit switch
JAM_DETECTDII0.2Belt jam detection sensor
CONV_RUNDOQ0.0Conveyor motor output
JAM_ALARMDOQ0.1Jam alarm indicator

Rung 1: PHOTO_SENS (NO) + CONV_RUN seal-in → END_LIMIT (NC) → JAM_DETECT (NC) → CONV_RUN output

Rung 2: JAM_DETECT (NO) → JAM_ALARM output

How it works: Product detected → conveyor runs → seal-in holds it running → product reaches end limit → END_LIMIT opens → conveyor stops. If a jam occurs anytime → JAM_DETECT opens the main rung → conveyor stops → alarm activates.


Example 4 – Product Counter with Batch Reset

Counts products on a conveyor and stops the line after 100 units. Used in packaging, filling, and batch production systems.

TagTypeAddressDescription
SENSORDII0.0Product detection sensor
RESET_PBDII0.1Counter reset push button
COUNTER_C1InternalC1CTU counter, preset value 100
LINE_RUNDOQ0.0Production line run output
BATCH_DONEDOQ0.1Batch complete indicator lamp

Rung 1: SENSOR (NO) → CTU Counter C1 (PV=100) [count input]

Rung 2: RESET_PB (NO) → CTU Counter C1 [reset input]

Rung 3: C1.DN (counter done, NC) → LINE_RUN output (line stops when batch complete)

Rung 4: C1.DN (counter done, NO) → BATCH_DONE lamp (lights when batch complete)


Example 5 – Three-Motor Sequence Start

Motors must start in sequence: Motor 1 first, then Motor 2 five seconds later, then Motor 3 five seconds after that. Used in conveyor systems, processing lines, and pump stations.

TagTypeAddressDescription
START_PBDII0.0System start button
STOP_PBDII0.1System stop button (NC)
T1TimerT1TON 5s — delay before Motor 2
T2TimerT2TON 5s — delay before Motor 3
MTR1_RUNDOQ0.0Motor 1 contactor
MTR2_RUNDOQ0.1Motor 2 contactor
MTR3_RUNDOQ0.2Motor 3 contactor

Rung 1: START_PB + MTR1_RUN seal-in → STOP_PB (NC) → MTR1_RUN (Motor 1 starts immediately)

Rung 2: MTR1_RUN (NO) → T1 Timer (5s delay)

Rung 3: T1.Q (NO) → MTR2_RUN (Motor 2 starts after 5s)

Rung 4: MTR2_RUN (NO) → T2 Timer (5s delay)

Rung 5: T2.Q (NO) → MTR3_RUN (Motor 3 starts after 10s total)

💡 Engineering Note: Sequential motor starts are essential in conveyor systems — you always start the last motor first (downstream) and the first motor last (upstream). This prevents product pile-ups. The ladder logic above starts upstream first, which is correct for a system where products flow Motor1 → Motor2 → Motor3.


Example 6 – Siemens TIA Portal Ladder Logic Format

Siemens uses a slightly different notation in TIA Portal. Here is the same motor start/stop circuit in Siemens format:

Siemens TagTypeAddressTIA Portal Symbol
Start_PBDI%I0.0–| |– (NO contact)
Stop_PBDI%I0.1–|/|– (NC contact)
Motor_RunDO%Q0.0–( )– (output coil)
TON_T1TimerDB1TON block (instance DB)

💡 Siemens TIA Portal Note: In TIA Portal, all addresses use the % prefix (%I0.0, %Q0.0, %MW0). Timers and counters use Instance Data Blocks (IDB) — each timer or counter needs its own DB assigned in the program properties. This is different from Allen-Bradley where timers/counters use tag structures directly.


Example 7 – Allen-Bradley / Rockwell Studio 5000 Format

Rockwell Allen-Bradley uses tag-based ladder logic with specific instruction names. Here is the same motor control circuit in Studio 5000:

AB Tag NameTypeData TypeInstruction
Motor1_StartDIBOOLXIC (Examine if Closed)
Motor1_StopDIBOOLXIO (Examine if Open)
Motor1_RunDOBOOLOTE (Output Energize)
Motor1_TimerTimerTIMERTON instruction
Motor1_CounterCounterCOUNTERCTU instruction

💡 Rockwell Studio 5000 Note: Allen-Bradley uses XIC instead of NO contact and XIO instead of NC contact. OTE is the output coil. Timers in Studio 5000 use a TIMER data type tag with .PRE (preset), .ACC (accumulated), .DN (done bit) and .TT (timer timing bit) members. No fixed addresses — everything is tag-based.


Ladder Logic vs Other PLC Programming Languages

ladder logic vs other PLC programming languages IEC 61131-3 comparison

The IEC 61131-3 standard defines 5 PLC programming languages. Ladder logic is the most widely used, but each language has its strengths:

LanguageBest ForDifficultyUsed In
Ladder Logic (LD)Machine control, discrete I/O⭐ EasiestAll industries
Function Block (FBD)Process control, PID loops⭐⭐ EasyProcess industries
Structured Text (ST)Complex algorithms, data⭐⭐⭐ MediumAdvanced projects
Sequential Function Chart (SFC)Batch, multi-step sequences⭐⭐⭐ MediumBatch processes
Instruction List (IL)Legacy systems only⭐⭐⭐⭐ HardOld PLCs (deprecated)

When to use Ladder Logic: Discrete machine control, motor control, conveyor systems, safety interlocks, basic process control — any application with ON/OFF inputs and outputs.

When to use other languages: Complex mathematical calculations (ST), modular process control (FBD), multi-step production sequences (SFC).

In practice, most modern PLC programs use a mix of languages — ladder logic for the main machine control, structured text for complex calculations, and function blocks for PID loops.

To learn about all 5 languages in detail, read: PLC Programming Languages Explained


Common Ladder Logic Programming Mistakes

These are the most frequent mistakes beginners and even experienced engineers make:

Mistake 1 – Using NO contact for Stop buttons
Stop buttons must always be NC contacts in ladder logic. If you use a NO contact for a stop button and the cable breaks, the button will stop working — the machine will keep running with no way to stop it. Always wire stop buttons as NC for fail-safe operation.

Mistake 2 – Forgetting the seal-in contact
Without a seal-in (holding) contact in parallel with the start button, the motor only runs while the start button is physically held down. Always add an auxiliary contact from the output coil in parallel with the momentary start input.

Mistake 3 – Double-coil programming
In a ladder logic program, each output coil address should only appear once. If you use Q0.0 as an output coil in two different rungs, only the last rung will control it — the first rung is ignored. This causes unpredictable behaviour and is one of the hardest bugs to find.

Mistake 4 – Missing emergency stop in every rung
Every rung that controls a potentially dangerous output (motors, hydraulics, valves) must include the emergency stop contact in series. A single E-stop rung at the start of the program is not enough in most safety applications.

Mistake 5 – No program comments or documentation
Ladder logic without rung comments and tag descriptions is extremely difficult to maintain. Always add a comment to every rung explaining what it does. Future engineers (and your future self) will thank you.

Mistake 6 – Incorrect timer/counter data types in Rockwell
In Studio 5000, if you assign the wrong data type to a timer tag (e.g., DINT instead of TIMER), the TON instruction will not work. Always verify your timer and counter tags use the correct data type (TIMER for TON/TOF, COUNTER for CTU/CTD).


Industrial Applications of PLC Ladder Logic

Ladder logic is used in virtually every industry that uses automated control systems:

IndustryTypical ApplicationKey Ladder Logic Used
ManufacturingAssembly line motor controlStart/stop, sequence, interlocks
Food & BeverageFilling, capping, labelling machinesCounters, timers, conveyor control
Water TreatmentPump control, level managementAnalog comparison, timer delays
Oil & GasValve sequencing, safety shutdownSafety interlocks, latching, ESD
AutomotiveRobotic welding, press controlSequence, timers, safety monitoring
PackagingCounting, wrapping, palletisingCTU counters, conveyor, reject gates
HVACAHU control, chiller sequencingTimers, analog comparison, alarms
Power GenerationGenerator control, load managementInterlocks, permissives, alarms

Frequently Asked Questions – PLC Ladder Logic

What is ladder logic in PLC?

Ladder logic is a graphical programming language used to program PLCs. It represents control logic using symbols that resemble electrical relay circuits, arranged in horizontal lines called rungs between two vertical power rails — forming a shape that looks like a ladder. It is the most widely used PLC programming language in industrial automation worldwide.

Why is ladder logic called ladder logic?

Ladder logic gets its name from the visual appearance of the program. The diagram has two vertical lines (rails) representing power, with horizontal lines (rungs) connecting them — exactly like a physical ladder. Each rung contains one line of control logic.

Is ladder logic easy to learn?

Ladder logic is considered the easiest PLC programming language to learn, especially for people with an electrical background. The symbols look like familiar electrical relay symbols, and the logic follows a visual left-to-right, top-to-bottom pattern that is intuitive to read. Most beginners can write basic motor control programs within a few days of starting.

What is the difference between NO and NC contacts in ladder logic?

A Normally Open (NO) contact passes current when its associated input signal is ON. A Normally Closed (NC) contact passes current when its associated input signal is OFF — it blocks current when the signal turns ON. Start buttons use NO contacts. Stop buttons and emergency stops must always use NC contacts for fail-safe operation.

What is a seal-in contact in ladder logic?

A seal-in contact (also called a holding contact or latch) is an auxiliary contact from the output coil placed in parallel with the start button. It keeps the output energized after the momentary start button is released, so the motor continues running without holding the button. It is one of the most fundamental concepts in ladder logic programming.

What is the difference between ladder logic in Siemens TIA Portal and Allen-Bradley Studio 5000?

The core logic is the same, but the notation differs. Siemens uses | | for NO contacts, |/| for NC contacts, and % prefix for addresses (%I0.0, %Q0.0). Allen-Bradley uses XIC for NO contacts, XIO for NC contacts, and tag-based addressing with no fixed address numbers. Siemens timers use Instance Data Blocks while Allen-Bradley timers use TIMER data type tags.

What is the PLC scan cycle and why does it matter for ladder logic?

The scan cycle is the repeating process the PLC follows: read inputs → execute ladder logic → write outputs → housekeeping. It completes in 1–20 milliseconds and repeats continuously. Understanding the scan cycle matters because the PLC executes rungs sequentially — a change in one rung does not affect the current scan of rungs above it. It only takes effect in the next scan.

How many rungs can a ladder logic program have?

There is no fixed limit — modern PLCs can handle thousands of rungs. A small machine might have 20–50 rungs. A large industrial plant program can have thousands of rungs across multiple program blocks. Performance depends on the PLC CPU speed, but even entry-level PLCs can handle hundreds of rungs within a 10ms scan time.


Conclusion

PLC ladder logic is the foundation of industrial automation programming. From a simple motor start/stop circuit to complex sequential control systems, ladder logic provides a visual, reliable, and universally understood way to control machines and processes.

The key concepts to master are:

  • NO and NC contacts and when to use each
  • The seal-in contact for maintaining motor control
  • Timers (TON, TOF) for time-based control
  • Counters (CTU) for production tracking
  • The PLC scan cycle and how it affects program execution

Start with the motor start/stop example, practice in PLC programming software with built-in simulators like Codesys or LogixPro, and build up to the more complex sequential examples. Ladder logic becomes intuitive with practice.

Related Guides:

Muhammad Shahid

Automation engineer based in Karachi, Pakistan, with hands-on experience in PLC programming, SCADA, and industrial control systems across oil and gas, power, food and beverage, and water industries. Writes about PLC fundamentals, ladder logic, vendor-specific instruction sets for Siemens, Allen-Bradley, and other major platforms, and industrial communication protocols.

Scroll to Top