PLC Sim Lab
Ladder logic how-tos

10 ladder logic examples with solutions

The fastest way to learn ladder logic is to solve real tasks. Here are ten classic examples, from easy to harder, each with the task, the solution and why it works. Try each one yourself first.

3 min read · Updated 2026-10-02

1. Start / stop with seal-in

Task: START runs a motor, it keeps running, STOP stops it.

|--+--[ START ]--+--[ STOP ]--( MOTOR )--|
|  +--[ MOTOR ]--+

The motor contact in parallel with START seals the rung in. STOP is wired NC, so it is an NO contact here. Full explanation.

2. Jog and run

Task: START latches the motor, JOG runs it only while held, STOP stops both.

|--+--[ START ]--+--[ STOP ]---------------( RUN_M )--|
|  +--[ RUN_M ]--+
|--+--[ RUN_M ]--+--[ STOP ]---------------( MOTOR )--|
|  +--[ JOG   ]--+

The seal-in goes on a memory bit (RUN_M), not on the motor output; otherwise a jog would latch the motor on.

3. Push-on / push-off with one button

|--[ P BUTTON ]-----------------------------( PULSE )--|
|--+--[ PULSE ]--[/LAMP ]--+--[ OFF ]------( LAMP  )--|
|  +--[/PULSE ]--[ LAMP  ]-+

Take only the rising edge of the button (one scan per press). A pulse with the lamp off turns it on; no pulse with the lamp on keeps it on: an exclusive OR.

4. Flashing lamp with two timers

|--[ ENABLE ]--[/T1 ]--------( TON T0, 0.5 s )--|
|--[ T0 ]--------------------( TON T1, 0.5 s )--|
|--[ T0 ]--------------------( LAMP )-----------|

T0 times the off half, T1 the on half; when T1 is done it resets T0 and the cycle repeats. Change the presets to change the rhythm.

5. Start warning before a machine moves

|--+--[ START ]--+--[ STOP ]--( REQ )--|
|  +--[ REQ   ]--+
|--[ REQ ]------------------( TON T0, 3 s )--|
|--[ T0 ]-------------------( MOTOR )-------|
|--[ REQ ]--[/T0 ]----------( HORN )--------|

A horn sounds for three seconds before the motor starts. STOP during the warning cancels everything.

6. Staircase light (off-delay)

|--+--[ FLOOR1 ]--+----------( TOF T0, 60 s )--|
|  +--[ FLOOR2 ]--+
|--[ T0 ]-------------------( LIGHT )----------|

An off-delay timer turns on at once and turns off a set time after the input goes off; every press restarts the time.

7. Count parts and stop at a batch

|--[ RUN ]--[/C0 ]----------( CONVEYOR )--|
|--[ EYE ]------------------( CTU C0, PV 10 )--|
|--[ C0 ]-------------------( BATCH_LAMP )--|
|--[ RESET ]----------------( RST C0 )--|

The counter counts each rising edge of the photo-eye; at the preset its done bit stops the conveyor.

8. Forward / reverse interlock

|--+--[ FWD ]--+--[ STOP ]--[/REV_K ]--( FWD_K )--|
|  +--[ FWD_K ]+
|--+--[ REV ]--+--[ STOP ]--[/FWD_K ]--( REV_K )--|
|  +--[ REV_K ]+

Each direction contains an NC contact of the other contactor, so both can never be on together. Details and hardware interlock.

9. Tank level: fill between LOW and HIGH

|--[ AUTO ]--[/LOW ]----------( SET FILL_M )--|
|--+--[ HIGH ]--+-------------( RST FILL_M )--|
|  +--[/AUTO ]--+
|--[ FILL_M ]-----------------( FILL_VALVE )--|

Below LOW the valve opens and stays open while the level rises between the switches, until HIGH. This band is called hysteresis and stops the valve chattering.

10. Traffic light with a timer chain

|--[ GO ]-------( TON T0, 5 s )--|   green time
|--[ T0 ]-------( TON T1, 2 s )--|   amber time
|--[ T1 ]-------( TON T2, 5 s )--|   red time
|--[/T0 ]-------( GREEN )--|
|--[ T0 ]--[/T1 ]--( AMBER )--|
|--[ T1 ]-------( RED )----|

Each timer starts the next; every lamp is a combination of done bits. Add a rung that restarts the chain to make it cycle. The full pedestrian crossing version is in the exercises.

Practise them

Every example above can be built and run in the free PLC Sim Lab Playground, in Siemens, Mitsubishi, Allen-Bradley or TOYOPUC addressing. The exercise pages have step-by-step video solutions and a button that opens the finished project in the simulator.

Watch it on the PLC Sim Lab channel

A full timer-chain exercise solved step by step, from the task to the tested program. Open on YouTube → · More videos →

Try it yourself. Wire sensors, contactors and a PLC, write ladder logic and press RUN in the free PLC Sim Lab Playground. Nothing to install.

Open the Playground →Guided lessons →

Frequently asked questions

Where can I practise ladder logic examples for free?

In the PLC Sim Lab Playground (plcsimlab.online/playground). It runs in the browser, needs no installation and simulates the wired panel as well as the PLC.

What is the easiest ladder logic example for beginners?

A push button lighting a lamp (one NO contact and one coil), followed by the start / stop circuit with a seal-in contact.

Are these examples the same in every PLC brand?

Yes, the logic is identical. Only the addresses and instruction names change, for example I0.0 in Siemens, X0 in Mitsubishi and I:0/0 with XIC in Allen-Bradley.