Back to Blog
Physical AI19 April 202612 min read

Ladder Logic Programming Tutorial: A Complete Beginner's Guide (2026)

Ladder LogicPLC TutorialBeginnersIEC 61131-3SiemensAllen-Bradley
Ladder Logic Programming Tutorial: A Complete Beginner's Guide (2026)

Ladder logic is the most widely used PLC programming language in the world. Based on the visual metaphor of electrical relay diagrams, it is deliberately designed to be readable by maintenance technicians, electricians, and controls engineers alike. If you are starting your journey into industrial automation, ladder logic is the first language you should master.

This tutorial takes you from zero knowledge to writing your first complete ladder logic program. By the end, you will understand contacts, coils, timers, counters, and latching — the building blocks of every real-world PLC program.

What Is Ladder Logic?

Ladder logic is a graphical programming language standardised as part of IEC 61131-3, the international standard for PLC programming languages. The name comes from its visual appearance: two vertical rails (representing power and neutral) with horizontal rungs between them, just like a physical ladder.

Each rung represents one logical statement. Execution flows left to right, and from the top rung to the bottom. If the conditions on the left side of a rung are true, the output on the right side is energised.

Basic Building Blocks

Contacts (Inputs)

Contacts are the input elements of ladder logic. There are two types:

  • Normally Open (NO) contact: Symbolised as two vertical lines with a gap ( `| |` ). Passes power when the associated input is TRUE.
  • Normally Closed (NC) contact: Symbolised as two vertical lines with a diagonal slash ( `|/|` ). Passes power when the associated input is FALSE.

Coils (Outputs)

Coils represent outputs. Three common types:

  • Output Coil ( `( )` ): Energises the output when the rung is true.
  • Latch/Set Coil ( `(S)` ): Permanently turns the output ON until explicitly reset.
  • Unlatch/Reset Coil ( `(R)` ): Turns a latched output OFF.

Timers

Two essential timers in every PLC:

  • TON (Timer On Delay): Starts timing when the input is TRUE. The output turns on after the preset time elapses.
  • TOF (Timer Off Delay): Starts timing when the input goes FALSE. The output stays on during the preset time.

Counters

  • CTU (Count Up): Increments by one on each rising edge of the input.
  • CTD (Count Down): Decrements on each rising edge.
  • RES (Reset): Clears counter or timer values.

Your First Ladder Program: Start/Stop with Latching

Let's build a classic motor start/stop circuit — the "Hello World" of industrial automation.

Inputs:

  • Start button (I0.0) — normally open push button
  • Stop button (I0.1) — normally closed push button

Output:

  • Motor contactor (Q0.0)

The logic:

``` | [I0.0] [I0.1] (Q0.0) | |--| |----| |-----------( )--| | | | | [Q0.0] | | |--| |----+ | ```

Rung 1 analysis:

  • When Start (I0.0) is pressed AND Stop (I0.1) is not pressed (NC is closed), Motor (Q0.0) energises.
  • The Q0.0 contact below Start is a seal-in contact — once the motor is running, this keeps it energised even after the start button is released.
  • Pressing Stop (I0.1) breaks the rung and turns the motor off.

Tutorial Example 2: Flashing Light (Timer Logic)

Requirement: Toggle an output LED on for 2 seconds, off for 2 seconds, repeatedly.

Variables:

  • TON1 — turns on after 2 seconds
  • TON2 — turns on 2 seconds after TON1
  • Q0.0 — LED output

Logic:

``` Rung 1: [NC TON2.DN]---[TON1 PT=2s] Rung 2: [NO TON1.DN]---[TON2 PT=2s] Rung 3: [NO TON1.DN]---[NC TON2.DN]---(Q0.0) ```

When TON1 completes, it starts TON2 on the next rung. When TON2 completes, it resets TON1 (because NC TON2.DN on Rung 1 becomes open). The LED is on only while TON1.DN is true but TON2.DN is false — creating a 2-second on, 2-second off cycle.

Best Practices for Beginners

  • Use descriptive tag names. `Motor_Conveyor_Start` is far better than `I0.0`.
  • Comment every rung. Your future self (and your maintenance team) will thank you.
  • Separate safety logic into its own dedicated rungs. Emergency stops should always break the power rail.
  • Avoid "spaghetti logic." If you find yourself using too many jumps, restructure into smaller, readable rungs.
  • Simulate before deploying. Siemens TIA Portal and Studio 5000 both have robust simulators — always test on virtual hardware first.
  • Version control your PLC programs. Export ladder files and commit them to Git just like regular code.

Common Mistakes to Avoid

  • Not using latches. Without a seal-in contact, your output turns off the moment you release the button.
  • Wrong NO/NC choice for stop buttons. Physical stop buttons should be wired as normally closed for safety — if the wire breaks, the machine stops.
  • Ignoring scan cycle timing. PLCs scan top-to-bottom. An output used later in the scan may read a different value than the same coil earlier.
  • Mixing logic styles. Pick one pattern for latching and stick to it across the whole program.

Where to Practise

The best way to learn ladder logic is hands-on. At EDWartens UK, our Professional Module gives you real Siemens S7-1200 and S7-1500 PLCs to practise on during 4–6 weeks of intensive training, starting with ladder logic basics and ending with complete SCADA-integrated systems.

If you are self-teaching, install TIA Portal's free demo or Studio 5000 trial and work through the examples above. Practise start/stop, flashing light, traffic light sequencing, and conveyor sorting — these four exercises cover 80% of real-world logic patterns.

Next Steps

Once you are comfortable with ladder logic, move on to Structured Text (ST) for complex algorithms, Function Block Diagrams (FBD) for process control, and then SCADA/HMI integration. Our Top 5 PLC Programming Languages guide explains when to use each.

For the fastest path from beginner to employed automation engineer in the UK, explore our CPD Accredited Professional Module — hands-on training with real hardware, industry-relevant projects, and career support.

About the Author

Brijin Chacko

Founder & CEO, EDWartens UK

Brijin Chacko is the founder and CEO of EDWartens UK, the training division of Wartens Ltd. With extensive experience in industrial automation, PLC programming, and engineering education, Brijin leads EDWartens' mission to deliver CPD Accredited, hands-on training that turns career changers and engineers into in-demand automation professionals across the UK and Europe.

View all articles by Brijin

Share this article

Ready to Start Your Automation Career?

Explore our CPD Accredited PLC, SCADA, and AI automation courses. Hands-on training with real industrial hardware and dedicated career support.

Explore our courses