PLC Ladder Logic Examples | 15+ Practical Applications
Learn with 15+ practical PLC Ladder Logic examples from real industrial applications. Motor control, timers, counters, and advanced logic patterns included.
What are the best ladder-logic examples for beginners?
Start with a motor seal-in circuit, then add permissives, feedback timeout, alarm latching, timers, counters and a small state sequence. Those patterns recur in conveyors, pumps, packaging machines and process skids. The most useful examples include normal operation, abnormal inputs, reset behavior and a test table—not only a screenshot of one rung.
The examples below use vendor-neutral ladder notation:
| | normally open contact
|/| normally closed instruction
( ) non-retentive output coil
(L) latch/set coil
(U) unlatch/reset coil
TON on-delay timer
CTU count-up counter
OSR one-scan rising-edge pulse
Adapt instruction names, timer time bases and address syntax to your PLC. Read how ladder logic executes during the scan before copying a pattern.
1. Three-wire motor start/stop
Goal: A momentary Start button runs a motor until Stop or an overload permissive opens.
Rung 1 — Motor command
|--|/| StopPB --| | OverloadOK --+--| | StartPB ----( MotorCmd )--|
| |
| +--| | MotorCmd --|
Rung 2 — Physical output
|--| | MotorCmd --|/| SafetyTrip --( MotorContactor )--|
Truth table:
| Stop healthy | Overload healthy | Start pressed | Prior MotorCmd |
Next MotorCmd |
|---|---|---|---|---|
| 1 | 1 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 0 | 1 | either | 1 | 0 |
| 1 | 0 | either | 1 | 0 |
Important: StopPB in this pseudocode represents the normalized “stop circuit healthy” condition. The field device, input polarity and safety architecture must be documented separately. An ordinary PLC input is not an emergency-stop safety function.
See the complete motor start/stop ladder tutorial for wiring and commissioning context.
2. Motor feedback timeout
Goal: Alarm when the PLC commands a motor but auxiliary feedback does not arrive within three seconds.
|--| | MotorCmd --|/| MotorRunFb --------[TON StartFbTimer 3s]--|
|--| | StartFbTimer.DN -------------------(L) FailedToStart ----|
|--| | ResetPB --|/| MotorCmd --| | MotorRunFb --(U) FailedToStart --|
The reset rung requires the command to be off and feedback to match the stopped condition. This avoids clearing a fault while its cause remains.
Test:
- Command plus feedback in 1 s → no alarm.
- Command with no feedback for 3 s →
FailedToStartlatches. - Feedback arrives after alarm → alarm remains until the documented reset condition.
- Feedback is already on before start → flag a separate “unexpected running” condition.
3. Conveyor off-delay after the last product
Goal: Keep a conveyor running for five seconds after a photo-eye clears.
|--| | AutoMode --| | ProductPresent ----( ConveyorDemand )--|
|--|/| ProductPresent --------------------[TOF ClearDelay 5s]--|
|--| | AutoMode --+--| | ConveyorDemand --+--( ConveyorCmd )--|
| | |
| +--| | ClearDelay.Q ----+
Use feedback and jam detection before treating ConveyorCmd as proof of movement. For a broader design, read the conveyor-belt PLC programming guide.
4. Tank fill with hysteresis
Goal: Start a fill valve at 30% level and stop at 80%.
|--[LES LevelPct 30.0] --| | AutoMode ----(L) FillRequest --|
|--[GRT LevelPct 80.0] -------------------(U) FillRequest --|
|--| | FillRequest --|/| LevelBad --|/| HighHigh --( FillValve )--|
Separate high-high protection from normal control. The above is process logic only; hazardous overflow may require independent protection.
5. Duty/standby pump alternation
Goal: Alternate the lead pump after each completed cycle while allowing one available pump to run if the other is faulted.
|--| | CycleComplete --[OSR CyclePulse] ----( ToggleLead )--|
Pump1Request :=
Demand AND (
(LeadIsPump1 AND Pump1Available)
OR NOT Pump2Available
);
Pump2Request :=
Demand AND (
(NOT LeadIsPump1 AND Pump2Available)
OR NOT Pump1Available
);
In ladder, implement the equations with branches and document what happens if neither pump is available. Do not toggle lead on a scan-level completion bit without a one-shot.
6. One-shot production counter
Goal: Count each product once even if the sensor stays on for multiple scans.
|--| | ProductEye --[OSR ProductPulse] --[CTU ProductCount 100]--|
|--| | ProductCount.DN ------------------( BatchQuantityReached )--|
|--| | NewBatchPB --|/| ConveyorRunning -[RES ProductCount]--|
Test with a long pulse, sensor chatter and power cycle. Decide whether the accumulated value must be retentive.
7. Alarm latch with acknowledge and reset
Goal: Preserve a transient fault, acknowledge operator awareness, and reset only after the condition clears.
|--| | HighTempCondition -----------------(L) HighTempAlarm --|
|--| | AckPB --| | HighTempAlarm ---------(L) HighTempAcked --|
|--| | ResetPB --|/| HighTempCondition ---(U) HighTempAlarm --|
|--| | ResetPB --|/| HighTempCondition ---(U) HighTempAcked --|
Acknowledgment is not reset. The alarm remains active while the process condition remains active.
8. Permissive and interlock summary
Goal: Explain why a pump will not start and why it stopped.
StartPermissive :=
AutoMode
AND SourceLevelOK
AND DestinationAvailable
AND PumpAvailable;
RunInterlock :=
NOT LowSuctionPressure
AND NOT MotorOverload
AND NOT SealFault;
PumpCmd := Demand AND StartPermissive AND RunInterlock;
Expose each input and a combined permissive/interlock state to the HMI. A generic “start failed” message wastes troubleshooting time.
9. Analog input scaling with quality
Goal: Convert a raw 4–20 mA input to 0–100 °C and reject a bad signal.
SignalGood := (RawAI >= RawLowValid) AND (RawAI <= RawHighValid);
IF SignalGood THEN
TemperatureC :=
(REAL(RawAI - RawAt4mA) / REAL(RawAt20mA - RawAt4mA))
* 100.0;
ELSE
TemperatureC := LastGoodTemperatureC;
TemperatureBad := TRUE;
END_IF;
Implement the calculation in the target PLC’s available math instructions or a reusable block. Never let a substituted last-good value look like healthy live data. Use the analog scaling calculator to verify two test points.
10. High-high trip voting
Goal: Demonstrate two-out-of-three process voting as an educational control pattern.
TwoOfThreeHigh :=
(HighA AND HighB)
OR (HighA AND HighC)
OR (HighB AND HighC);
This Boolean example does not establish a safety integrity level or replace the required sensor diagnostics, proof testing, independence and safety lifecycle.
11. Traffic-light state sequence
Goal: Use states rather than interdependent timer-done bits.
NS_GREEN → NS_YELLOW → ALL_RED_1
→ EW_GREEN → EW_YELLOW → ALL_RED_2
→ NS_GREEN
Output decode:
NsGreen := State = NS_GREEN;
NsYellow := State = NS_YELLOW;
NsRed := NOT (NsGreen OR NsYellow);
EwGreen := State = EW_GREEN;
EwYellow := State = EW_YELLOW;
EwRed := NOT (EwGreen OR EwYellow);
See the complete traffic-light state-machine example for code, limitations and acceptance tests.
12. Batch mixer phase sequence
Goal: Coordinate dose, mix, heat/hold and transfer.
VERIFY_READY → TARE → DOSE_A → DOSE_B
→ START_AGITATOR → HEAT → HOLD → TRANSFER → COMPLETE
Each phase exposes Ready, Running, Complete, Faulted and actual process values. Transition on measured completion rather than elapsed time alone. The batch-process PLC programming guide contains the full example.
13. Packaging reject register
Goal: Track a failed inspection from the sensor to a downstream reject station.
At each encoder/index pulse:
RejectRegister[5] := RejectRegister[4];
RejectRegister[4] := RejectRegister[3];
RejectRegister[3] := RejectRegister[2];
RejectRegister[2] := RejectRegister[1];
RejectRegister[1] := RejectRegister[0];
RejectRegister[0] := InspectionFail;
RejectSolenoid := IndexPulse AND RejectRegister[5];
Production code must define missed indexes, double-detection, conveyor slip, reject confirmation and register recovery after a stop.
14. Star-delta training sequence
Goal: Teach mutually exclusive contactor commands.
MainCmd := MotorRequest AND AllPermissives;
StarCmd := MainCmd AND NOT TransitionTimer.Q AND NOT DeltaFeedback;
DeltaCmd := MainCmd AND TransitionTimer.Q AND NOT StarFeedback;
Actual starters require correctly engineered power circuitry, mechanical/electrical interlocking, motor suitability and protection. Do not build a motor starter from PLC logic alone.
15. Manual/automatic command arbitration
Goal: Ensure one final command owner.
AutoRequest := AutoMode AND SequenceCallsMotor;
ManualRequest := ManualMode AND ManualStartPB;
MotorRequest :=
(AutoRequest OR ManualRequest)
AND NOT ModeConflict
AND CommonPermissives;
Manual mode should not bypass safety functions or essential equipment protections. Define whether process interlocks remain active in manual operation.
16. First-scan initialization
Goal: Initialize nonretentive control state without energizing equipment unexpectedly.
|--| | FirstScan ----------------( State := STOPPED )--|
|--| | FirstScan ----------------(U) AutoRestartRequest --|
|--| | FirstScan ----------------[RES TemporaryTimers]--|
Do not reset legitimate retained production totals or recipe data blindly. Document retention variable by variable.
17. Jam detection
Goal: Detect a commanded conveyor with no downstream product movement.
|--| | ConveyorRunFb --| | ProductExpected --|/| ExitEyePulse
|----------------------------------------[TON JamTimer 4s]--|
|--| | JamTimer.DN ----------------------(L) ConveyorJam --|
|--| | ConveyorJam ----------------------( ConveyorStopRequest )--|
Set the timer from the maximum legitimate travel time plus margin, not from guesswork. Pause or reset it under every documented mode change.
Why scan order matters
PLCs normally read inputs, execute logic and update outputs cyclically. A tag written on an earlier rung can affect a later rung in the same scan; a physical output may not change until output update.
Reproducible practice project
Combine examples 1, 2, 3, 6 and 7:
- Start/stop a conveyor motor.
- Require run feedback within three seconds.
- Count ten products with a one-shot.
- Keep the conveyor running five seconds after the tenth product.
- Latch a start-failure or jam alarm.
- Require the cause to clear before reset.
Acceptance tests
| ID | Injected condition | Expected result |
|---|---|---|
| L01 | Normal start and feedback | Motor runs; no alarm |
| L02 | Start without feedback | Failed-to-start alarm after 3 s |
| L03 | Product eye stays on for 1 s | Count increases once |
| L04 | Ten valid product pulses | Batch quantity bit turns on |
| L05 | No exit pulse while movement expected | Jam alarm after defined time |
| L06 | Press reset while cause remains | Alarm does not reset |
| L07 | Stop during timing | Output turns off and timers follow documented behavior |
| L08 | Power cycle with request present | No unintended restart |
Save the I/O list, ladder screenshot, truth table and test results. That evidence is more useful than claiming the program “works.”
Practise the examples in a browser
PLC Simulation Software provides interactive ladder-logic scenarios for motor control, conveyors, traffic lights, batch mixing and other sequence exercises.
Ownership disclosure: PLC Programming and PLC Simulation Software are operated by the same publisher. The simulator is a training environment, not a vendor PLC runtime or a safety controller.
Start the free PLC simulator, reproduce L01–L08 and then reimplement the same behavior in your target vendor software.
Safety and implementation limits
- Never treat ordinary PLC logic as an emergency-stop or required safety function.
- Verify input polarity against electrical drawings.
- Use output feedback where commanded state is not sufficient.
- Define power-up, stop, fault and reset behavior.
- Validate timer units and retentive behavior on the target PLC.
- Use vendor manuals for instruction edge cases.
- Test with isolated simulation or approved commissioning procedures before connecting actuators.
Key takeaways
- Start with one simple rung and add one requirement at a time.
- Use readable tags and expose permissives.
- Count edges, not scans.
- Separate state transitions from outputs.
- Measure physical completion instead of trusting commands or time alone.
- Treat acknowledgment and reset as different actions.
- Prove every example with a small acceptance-test table.


