PLC Simulator
PLC field notesexamples

PLC Programming Examples: A Curated Hub of Worked Ladder Logic

A categorized hub of worked PLC programming examples and ladder logic examples — motor control, sequencing, process and sensing — each with an explanation and a link you can open in a free browser simulator.

PLC Simulation Software8 min read

The fastest way to learn PLC programming is to read worked examples, then rebuild them yourself. This hub collects our best ladder logic examples — sorted by category and difficulty — so you can find one that matches what you are trying to build and open it in a free browser PLC simulator without installing anything.

Every example below links to a full walkthrough with the ladder logic, the I/O list and the reasoning behind each rung. Start with the start/stop seal-in if you are new, then work down the list as the concepts stack on each other.

A curated hub of worked PLC programming and ladder logic examples

How the examples are organized

We group examples into four families. Almost every real machine program is a mix of these, so learning one example from each gives you a toolkit that transfers everywhere.

Four categories of PLC programming examples: motor control, sequencing, process and sensing

  • Motor control — starting, stopping and protecting motors and actuators.
  • Sequencing — making things happen in a fixed order, often on timers.
  • Process control — holding a temperature, level or flow at a setpoint.
  • Sensing & logic — turning raw sensor inputs into clean, debounced signals.

The "hello world" of ladder logic: start/stop seal-in

Before any of the larger examples, get the start/stop seal-in rung straight. A momentary Start button latches a motor on, the motor seals itself in around the start contact, and a normally-closed Stop button drops it. It is the single most reused pattern in industrial control.

Start stop seal-in ladder rung, the canonical first PLC programming example

Read the full walkthrough in seal-in rungs explained — it covers why the Stop contact is wired normally-closed and how the seal-in branch holds the coil. Once that clicks, the rest of the examples are variations on the same idea.

Examples at a glance

Here is every worked example in this hub with its difficulty and the core concepts it practices. Pick something one notch above what you already know.

Comparison table of PLC programming examples by difficulty and concepts practiced

Motor control examples

These build directly on the seal-in pattern and add timing, interlocks and direction control.

Conveyor belt control

A conveyor is the classic next step after start/stop: you add a run-on timer so the last part clears the belt, photo-eye interlocks, and often a jam-detect rung. See conveyor belt PLC programming for the full ladder logic.

Pump control

Pump logic introduces lead/lag duty sharing, dry-run protection and level-based start/stop using float switches. The worked example in PLC pump control shows how to alternate two pumps so they wear evenly.

Sequencing examples

Sequencing is where timers and counters earn their keep — steps fire in order, each waiting on the one before it.

Traffic light controller

The traffic light is the textbook sequencing exercise: a fixed loop of states driven by on-delay timers, with a clear safety constraint (never two greens at once). Walk through it in traffic light PLC programming.

Bottle filling line

A filling line chains sensing, a fill valve, a dwell timer and a part counter into one repeating cycle. The bottle filling PLC example is a great bridge between simple sequencing and a real production cycle.

Elevator control

An elevator adds request queuing and direction logic on top of sequencing — the most involved example in the hub. The elevator PLC programming walkthrough breaks the call logic into manageable rungs.

Process control examples

Process examples hold a measured value at a setpoint rather than just switching things on and off.

Temperature control

Bang-bang and hysteresis control of a heater is the gentlest introduction to process logic — turn the heater on below the lower limit, off above the upper limit. See PLC temperature control for the ladder and the deadband maths.

HVAC control

HVAC combines temperature control with sequencing (staged heating/cooling) and interlocks (don't run the compressor and the heater together). The HVAC PLC programming example ties several patterns together.

Sensing & logic building blocks

These are not full machines, but you will drop them into almost every program above.

Timers — TON, TOF and TP

Nearly every example on this page uses a timer somewhere. If on-delay, off-delay and pulse timers are still fuzzy, start with PLC timers explained and its timing diagrams.

Counters — CTU and CTD

Count parts, batches or cycles with up and down counters. The PLC counters CTU and CTD example shows the count, reset and done-bit behavior you'll reuse in the bottle-filling line.

How to practice an example so it sticks

Reading an example is not the same as understanding it. Work through each one like this:

Checklist for practicing a PLC programming example effectively

The non-negotiable step is rebuild it from scratch without looking. If you can recreate the rungs from a blank editor and explain why each one exists, you own the pattern.

Which example should you start with?

If you are not sure where to jump in, follow your current level rather than the topic that sounds most interesting.

Flowchart for choosing a PLC programming example by your experience level

Beginners should always start at the seal-in rung even if it feels too simple — every later example assumes it.

Run any of these in your browser

You don't need vendor software or hardware to follow along. Every example here can be built and tested in the free browser PLC simulator: wire the inputs, write the ladder logic, force a contact and watch the coil energise in real time. When you want a guided version with checks and a pass condition, open the matching task in the scenarios library and build it against test cases.

Bookmark this page — we add new worked examples regularly, and each one links back here so the whole set stays one click away.

FAQ

What is the best first PLC programming example? The start/stop seal-in rung. It is the most reused pattern in industrial control and every other example on this page builds on it.

Are these ladder logic examples free to try? Yes. Every example links to a walkthrough you can rebuild for free in the browser PLC simulator — no install, no hardware.

What is the difference between an example and a scenario? An example is a written walkthrough with the ladder logic explained rung by rung. A scenario is the same task set up in the simulator with test cases and a pass condition so you can verify your own solution.

In what order should I work through these examples? Start with the seal-in rung, then conveyor and pump (motor control), then traffic light and bottle filling (sequencing), then temperature and HVAC (process), pulling in the timer and counter building blocks as you need them.

ShareX / TwitterLinkedIn

From reading to running logic

Practice this yourself in the simulator

Start with guided PLC practice in your browser. No install and no credit card required.

Start practising free

Continue learning

Related field notes

All articles
fundamentals
ladder logic

PLC Counters Explained: CTU, CTD and CTUD (with Ladder Logic)

PLC counters explained in plain English. How the CTU up-counter, CTD down-counter and CTUD up/down counter work, the CU/CD/RESET/PV/CV/Q parameters, ladder logic examples, and the IEC 61131-3, Allen-Bradley, Siemens and Mitsubishi names.

9 min read
tutorial
examples

PLC Pump Control Logic: Duty/Standby and Lead-Lag (Ladder Examples)

Pump control logic in a PLC explained with ladder diagrams. Start/stop on level, seal-in rungs, duty standby alternation, lead lag pump control and automatic fault changeover — with state, timing and architecture diagrams.

9 min read
fundamentals
ladder logic

One-Shots & Edge Detection in PLCs: ONS, OSR and R_TRIG

One shot ladder logic explained. How rising-edge and falling-edge detection works, R_TRIG and F_TRIG, the Allen-Bradley ONS/OSR one-shot, P/N edge contacts, timing diagrams and the pitfalls that bite beginners.

8 min read

Technical reference and worked-example guide

PLC programming examples: field reference

Direct answer

The reader can select an example by control problem, predict its scan behavior, run changed cases and adapt it without copying hidden assumptions.

Written for beginners, technicians and instructors looking for start-stop, timer, counter, interlock, sequence, analog and fault-handling examples they can explain.

an automation engineer correlating ladder logic, scan timing, PLC I/O and a controlled test result at a debug bench while studying PLC programming examples that transfer from requirement to tested machine behavior
System map / 02

NODE 01observable

Definition

Machine requirement, initial state, inputs, outputs, feedback, stop priority, modes, timing, faults, reset and acceptance criteria.

NODE 02observable

Signal path

Plain-language requirement through tags, rung or block execution, owned outputs, modeled equipment and independent feedback.

NODE 03observable

Worked example

Start, run, normal stop and repeat operation from a clean state for each selected pattern.

NODE 04observable

Limits

Held inputs, simultaneous commands, timer boundaries, feedback delay, restart, mode changes and repeated events.

NODE 05observable

Common mistake

A requirement, scan-order, state, timer, output-owner, I/O, actuator or feedback mismatch.

NODE 06observable

Verification

The adapted pattern peer-reviewed and regression-tested in official target software and representative hardware.

Answer surface / 07

What are the best PLC programming examples for beginners?

Start with input-to-output, three-wire start-stop, interlock, TON timing and CTU counting, then build one explicit state sequence with feedback and fault recovery.

How should I use a ladder logic example without copying it blindly?

Rewrite its operating contract, rename tags, predict scans, test boundaries and explain every state before transferring the behavior to your controller.