PLC Ladder Logic Examples: 10 Rungs & Timer Calculator

Share:
PLC
PLC Ladder Logic Examples: 10 Solved Rungs With I/O Tables, From Start Stop Seal In to Star Delta, Plus a Timer Preset Calculator

Reading about contacts and coils is easy, but writing a working rung for a real motor or pump is where most students get stuck. These ten solved rungs show the I/O, the logic in plain words and the mistakes that cause trouble on site.

Seal In Circuit Interlock & Jog TON & TOF Timers Counters & Pumps Star Delta Sequence

Ten solved PLC rungs with I/O tables cover motors, pumps, tanks, alarms and star delta starters. Each rung is explained in plain words, with common mistakes and a timer preset calculator.

Hello everyone, today we are going to work through plc ladder logic examples for motors, pumps, tanks, alarms and star delta starters, one rung at a time.
plc ladder logic examples

What Are PLC Ladder Logic Examples?

PLC ladder logic examples are small, solved programs that show how contacts, coils, timers and counters combine to control real machines such as motors, pumps and conveyors. Each example pairs an I/O table with a rung you can type into any PLC software and test.

Quick Answer
  • A seal in contact parallel to Start keeps a motor running after the button is released
  • Interlocks use the opposite output as a normally closed contact so two outputs never run together
  • TON delays switching on, TOF delays switching off, CTU counts rising edges
  • Timer preset equals delay in ms divided by the time base in ms

If symbols like XIC and XIO are new to you, read our ladder logic basics for beginners first. Every rung here assumes a normal PLC scan cycle of read inputs, solve logic, write outputs.

Start stop ladder logic example with a seal in contact in parallel with the start push button
Image credit: PLC Academy. Image courtesy of PLC Academy, shown here for educational reference.
Advertisement

How to Write a Ladder Logic Program

1
Write the I/O List
Every button, sensor and output with its address
2
Describe in Words
One sentence per output
3
Draw One Rung per Output
Conditions on the left, one coil on the right
4
Add Safety
Stop and overload in series with the coil
5
Simulate and Commission
Test every input, then check real signals

In all plc ladder logic examples, write each coil only once, because the last rung that writes a coil always wins. Our guide on PLC programming languages explains why ladder suits discrete logic.

Quick Tip

Wire Stop and overload contacts as normally closed in the field, then use a normally open (XIC) instruction for them in the program. A broken wire then stops the motor instead of leaving it unstoppable.

10 PLC Ladder Logic Examples With I/O Tables

Addresses use the Siemens style I0.0 and Q0.0, but these plc ladder logic examples work in Allen Bradley, Delta or Mitsubishi software too. Change only the addresses.

Example 1: Seal In Circuit in Ladder Logic

TagAddressDevice
Start PBI0.0NO push button
Stop PBI0.1NC push button
OverloadI0.2NC relay contact
MotorQ0.0Contactor coil
1
Branch
XIC Start I0.0 in parallel with XIC Motor Q0.0
2
Series
XIC Stop I0.1, then XIC Overload I0.2
3
Coil
OTE Motor Q0.0

When Start is pressed the coil turns on, and the parallel Q0.0 contact holds it on after the button is released. Pressing Stop or a trip of the thermal overload relay opens the series path and the motor drops out.

A seal in rung is safer than a SET and RESET pair, which is why it opens these plc ladder logic examples. After a power failure the output stays off until Start is pressed again.

Example 2: Forward Reverse Interlock

TagAddress
Forward PBI0.0
Reverse PBI0.1
Stop PBI0.2
Forward contactorQ0.0
Reverse contactorQ0.1
1
Rung 1
(XIC I0.0 OR XIC Q0.0) AND XIC I0.2 AND XIO Q0.1, output Q0.0
2
Rung 2
(XIC I0.1 OR XIC Q0.1) AND XIC I0.2 AND XIO Q0.0, output Q0.1

Each rung holds a normally closed contact of the other output, so forward and reverse never run in the same scan. The contactors still need a hardwired interlock through their auxiliary contacts.

Example 3: Jog and Run Selection

In jog mode the motor runs only while Jog is held, useful for aligning a conveyor belt. A run bit M0.0 is latched by Start and Stop, and the output rung is XIC M0.0 OR XIC Jog I0.3, driving Q0.0.

Never put Jog in parallel with the seal in contact, or the motor latches on while jogging. Combine jog only at the output rung.

Do You Know?

Southern Illinois University notes for course ET 438b point out that an NC Stop button is programmed with XIC, not XIO. PLC logic follows the input state, not the schematic symbol.

Ladder Logic Timer Examples

Timers appear in most plc ladder logic examples because real machines rarely switch at the instant a button is pressed. Our detailed article on TON, TOF and RTO timer instructions covers the status bits, while the two rungs below show them at work.

Example 4: ON Delay Timer for a Pump

TagAddressSetting
Pump start commandM0.1From seal in rung
TimerT1 (TON)PT 5 s
Pump contactorQ0.2Output
1
Rung 1
XIC M0.1 drives TON T1, preset 5 s
2
Rung 2
XIC T1.DN drives Q0.2 pump

The pump starts 5 seconds after the command, giving a suction valve time to open. When M0.1 turns off, the TON resets and the pump stops at once.

Example 5: OFF Delay Timer for a Cooling Fan

A heater output Q0.3 drives a TOF timer T2 with a preset of 60 s, and the DN bit of T2 drives the fan Q0.4. The fan starts with the heater and runs one minute after it turns off.

Students often swap TON and TOF here. Say the sentence aloud first, fan stops one minute after the heater stops, and the TOF choice becomes obvious.

Solved example: timer preset
Delay = 5 s = 5000 ms
Time base = 100 ms
Preset = 5000 ÷ 100
Preset = 50

Controllers such as the Allen Bradley SLC 500 store presets as counts of the time base, while IEC style timers take a direct time value. The calculator converts seconds into counts.

Timer Preset Calculator
Timer Preset
Preset 50 for 5000 ms at 100 ms time base
Advertisement

Example 6: Counter for Bottles on a Conveyor

TagAddressSetting
Bottle sensorI0.4PNP photo sensor
CounterC1 (CTU)PV 12
Carton pusherQ0.5Solenoid valve
Pusher homeI0.5Reed switch
1
Rung 1
XIC I0.4 drives CTU C1 with a preset of 12
2
Rung 2
XIC C1.DN drives Q0.5 pusher
3
Rung 3
XIC I0.5 AND XIC C1.DN resets C1

The counter adds one on each rising edge, so a bottle that stops at the sensor counts once. Pick the right type from our guide to NPN and PNP sensors.

Our page on CTU and CTD counter instructions covers accumulator limits and overflow. Very fast products need a high speed counter input.

Example 7: Tank Fill With Level Switches

TagAddressContact
Low level switchI0.6On when water is below low
High level switchI0.7On when water reaches high
Fill pumpQ0.6Output
1
Branch
XIC I0.6 low level in parallel with XIC Q0.6
2
Series
XIO I0.7 high level
3
Coil
OTE Q0.6 fill pump

The pump starts when the level falls below the low switch, seals itself in, and stops only when the high switch operates. The gap between switches is a deadband that stops short cycling.

Confirm whether each switch is NO or NC when wet before writing the rung. See float level switch working and the guide to float switch wiring for both cases.

Example 8: Alternating Duty and Standby Pumps

Two pumps share wear when a toggle bit M1.0 flips at the end of each duty cycle. A one shot on the falling edge of demand flips M1.0, and the pump rungs read Pump A = demand AND XIO M1.0, Pump B = demand AND XIC M1.0.

Without a one shot the bit flips every scan, which is why the ONS, OSR and OSF instructions matter. Add a fault input so the healthy pump takes over.

Myth: A Stop button should be programmed with XIO because it is a normally closed button
Fact: The instruction follows the input signal, so a healthy NC Stop is ON and needs XIC
Myth: SET and RESET coils are always better than a seal in rung
Fact: A latched output can restart after power returns, which is unsafe for motors
Myth: Software interlock alone protects forward and reverse contactors
Fact: A welded contactor ignores the PLC, so a hardwired interlock is still required

Example 9: Alarm With Acknowledge

StateLampHorn
Fault active, not acknowledgedFlashingOn
Fault active, acknowledgedSteadyOff
Fault cleared, acknowledgedOffOff

A fault sets an alarm bit, and the Ack button latches an acknowledge bit while the alarm is active. The lamp rung is alarm AND (ack OR flasher bit), and the horn rung is alarm AND XIO ack.

This announce, acknowledge and clear sequence matches ISA 18.2 alarm states, covered in SCADA alarm management. For several trip inputs, the first out alarm logic shows which fault happened first.

Example 10: Star Delta Starter Sequence

TagAddressRole
Main contactor KM1Q1.0Supply to motor
Star contactor KM3Q1.1Shorts winding ends
Delta contactor KM2Q1.2Run connection
Star timerT3 (TON)PT 7 s
Pause timerT4 (TON)PT 0.1 s
1
Rung 1
Start seal in rung drives KM1 Q1.0
2
Rung 2
Q1.0 AND XIO T3.DN AND XIO Q1.2 drives star Q1.1
3
Rung 3
Q1.0 drives TON T3, star time
4
Rung 4
T3.DN drives TON T4, short pause
5
Rung 5
T4.DN AND XIO Q1.1 drives delta Q1.2

The motor starts in star at reduced voltage, then switches to delta. Mutual XIO contacts and a short pause stop star and delta closing together, which would short the supply.

Set the star time by watching the motor reach near full speed. Compare the starter with others in DOL vs star delta starter, and see the induction motor working principle to understand why starting current falls in star.

Seal In Rung
  • Drops out after power loss
  • Stop is always dominant
  • Standard for motor starters
SET and RESET Coils
  • Can survive a power cycle
  • Harder to trace during faults
  • Useful for sequence step bits
Advertisement

Common Mistakes in Ladder Logic Programs

SymptomLikely CauseFix
Motor will not stopStop programmed with XIO on an NC buttonUse XIC for NC field contacts
Output flickersSame coil written on two rungsOne coil per output
Counter counts wrongSensor bounce or missing edgeUse a one shot or debounce timer
Motor restarts after power cutSET coil used for motorUse a seal in rung

When one of your own plc ladder logic examples looks right but the machine misbehaves, follow our PLC troubleshooting steps. Watch the rung online and compare it with the real input lamps.

Quick Tip

Run every rung in a simulator and toggle each input by hand before wiring field devices. Our list of PLC simulation software shows free options.

  • Every output has exactly one coil
  • Stop, overload and emergency stop are in series and wired NC
  • Opposite outputs carry an XIO interlock
  • Timer presets match the time base
  • Motor rungs restart only after a fresh Start

After these rungs, move on to sequences, where the SQO and SQI sequencer instructions replace long chains of step bits. The ladder logic overview on Zenta Engineering is a useful revision page.

Real plants also scale analog signals, and the PLC raw count calculator helps there. Practise all ten plc ladder logic examples in free software before touching hardware.

PDF
PLC Programming Techniques, Lesson 19
Southern Illinois University lecture notes on seal in, timers and counters
Do You Know?

The SIU lecture notes show a TON with a 0.01 s time base and a preset of 100 giving a one second delay. With a 1.0 s time base the same preset gives 100 seconds.

PLC Ladder Logic Examples FAQ

What is a seal in circuit in ladder logic?

A seal in circuit places an output contact parallel to the Start button, so the output stays energised after the button is released. It drops out only when a series Stop or overload condition opens the rung.

This behaviour copies the holding contact of a hardwired contactor starter. It also stops the motor from restarting by itself after a power failure, which makes it safer than a latch coil.

What are the basic instructions used in ladder logic?

The basic instructions are the normally open contact, the normally closed contact and the output coil. Timers, counters, compare and math blocks build on them, as most plc ladder logic examples show.

Allen Bradley calls the coil OTE and the contacts XIC and XIO, while Siemens uses other names. The logic itself works the same way in every brand of controller.

What is the difference between TON and TOF timers?

A TON timer waits for its preset time after the rung becomes true, then turns its done bit on. It resets as soon as the rung goes false again.

A TOF timer turns its done bit on as soon as the rung is true and keeps it on for the preset time after the rung goes false. Use TON for start delays and TOF for run on delays like cooling fans.

How do you calculate a PLC timer preset value?

Divide the required delay in milliseconds by the timer time base in milliseconds. For a 5 second delay with a 100 ms base, the preset is 5000 divided by 100, which equals 50.

Check that the result stays below the preset limit of your controller, such as 32767 on an SLC 500. If it is higher, choose a larger time base or use a cascaded timer.

Why is the Stop button wired normally closed in a PLC?

A normally closed Stop button keeps the input ON while everything is healthy. If the wire breaks or the terminal works loose, the input goes OFF and the motor stops safely.

In the program the Stop input is therefore used with a normally open instruction. Many students get this wrong because the schematic symbol and the ladder instruction look opposite to each other.

Advertisement

Related Articles

External References

What We Learn Today

  • How to build start stop seal in, forward reverse interlock and jog rungs with clear I/O tables that work on any PLC brand you use.
  • How TON, TOF and CTU instructions solve pump delays, cooling fans and bottle counting, plus how to calculate a timer preset from seconds.
  • How plc ladder logic examples for tank filling, alternating pumps, alarm acknowledge and star delta starters are written, tested and debugged on site.
I hope you like above blog. There is no cost associated in sharing the article in your social media. Thanks for reading!! Happy Learning!!
Sunayana Gadepatil, author at Instrumentation Blog
Author · instrumentationblog.in
Ms. Sunayana Gadepatil is an instrumentation professional, technical writer, and the author behind Instrumentation Blog. With a strong interest in industrial instrumentation, process measurement, and automation, she specializes in simplifying complex technical concepts into clear, practical, and easy to understand insights. Through her articles, Ms. Sunayana shares valuable knowledge on flow, pressure, level, temperature, control systems, and industrial automation for engineers, students, technicians, and industry professionals.
Technically reviewed on

Leave a Reply

Your email address will not be published. Required fields are marked *