PLC Ladder Diagram Examples: 17 Industrial Programs with I/O Tables, Annotated Rungs, and Cross-Brand Notation
This is a free printable ladder diagram plc examples: download the diagram as SVG or open it and print to paper or PDF.
This is the most comprehensive collection of PLC ladder diagram examples available online — 17 fully solved programs across seven categories: basic logic, timers, counters, motor control, process control, safety circuits, and real-world industrial applications. Every example includes a problem statement, I/O allocation table, complete annotated ladder diagram described rung by rung, and a cross-brand notation comparison showing Allen-Bradley, Siemens, and Omron address formats. Unlike resources that list problem statements without solutions, every example here is solved in full.
## PLC Ladder Diagram Examples: How to Use This Guide
This guide is organised into seven categories so you can jump directly to the type of example relevant to your study or project. Each example follows the same format: problem statement → I/O allocation table → full annotated ladder solution → rung-by-rung explanation. A cross-brand notation table at the end shows how the same logic is addressed in Allen-Bradley (Studio 5000/RSLogix 500), Siemens (TIA Portal LAD), and Omron (CX-Programmer) — the three most widely deployed PLC platforms globally.
For each example, the ladder logic is described in text notation: XIC TagName = normally-open contact on TagName; XIO TagName = normally-closed contact; OTE TagName = output coil; [||] = parallel branch (OR). The notation mirrors exactly what you see in Studio 5000 or TIA Portal.
## CATEGORY 1: Basic Logic Examples
### Example 1 — AND Logic: Two Limit Switches Enable Output
**Problem:** A hydraulic press cycle must only initiate when BOTH a guard door closed limit switch (LS1) AND an operator foot pedal (PED1) are active.
**I/O Table:** I:0/0 = LS1 (NO limit switch, bit=1 when guard closed), I:0/1 = PED1 (NO foot pedal), O:0/0 = Press_Cycle.
**Ladder:** Rung 1: XIC LS1 — XIC PED1 — OTE Press_Cycle.
**Explanation:** Series XIC contacts implement AND logic. Both must be TRUE for the press cycle to initiate. If the guard opens mid-cycle (LS1 drops to 0), the cycle immediately interrupts — critical safety behaviour for pressing and stamping machines.
### Example 2 — OR Logic: Any of Three Sensors Triggers Alarm
**Problem:** A fire suppression alarm must activate if any of three smoke detectors (SD1, SD2, SD3) triggers.
**I/O Table:** I:1/0 = SD1, I:1/1 = SD2, I:1/2 = SD3 (all NO, bit=1 on detection), O:0/1 = Alarm.
**Ladder:** Rung 1: [XIC SD1 || XIC SD2 || XIC SD3] — OTE Alarm.
**Explanation:** Three parallel XIC branches implement a 3-input OR. Any branch TRUE energises the alarm. This is the fundamental redundant-detection pattern in fire, gas, and intrusion alarm systems.
### Example 3 — Start/Stop Seal-In Motor Circuit
**Problem:** Standard motor start/stop with seal-in. (See detailed solution in ladder-diagram-examples.)
**Ladder:** Rung 1: [XIC Start || XIC Motor] — XIC Stop_NC — XIC OL_NC — OTE Motor.
**Key point:** Stop and OL are NC-wired; use XIC (not XIO) on these inputs. Fail-safe: wire break = input bit 0 = XIC opens = motor stops.
### Example 4 — Single Push-Button Toggle (OSR / One-Shot)
**Problem:** One button toggles a light ON/OFF alternately.
**Ladder:** Rung 1: XIC PB1 — ONS Storage_Bit_1 — XIO Light — OTL Light. (Turn ON if currently OFF) Rung 2: XIC PB1 — ONS Storage_Bit_2 — XIC Light — OTU Light. (Turn OFF if currently ON)
**Note:** Each ONS instruction requires its own unique storage bit address.
## CATEGORY 2: Timer Examples (TON, TOF, RTO)
### Example 5 — TON: Pump Start Delay (10 s)
**Problem:** Pump starts 10 seconds after level sensor confirms high level, to prevent false starts from sensor bounce.
**Ladder:** Rung 1: XIC Level_High — TON T4:0 PRE=10000. Rung 2: XIC T4:0/DN — OTE Pump.
**Critical parameters:** PRE = 10000, Time Base = 0.001 s (1 ms). Verify time base in your PLC software — some older Allen-Bradley formats use 0.01 s or 1.0 s time base.
### Example 6 — TOF: Cooling Fan Run-On (30 s)
**Problem:** Cooling fan runs 30 seconds after motor stops.
**Ladder:** Rung 1: XIC Motor_Run — TOF T4:1 PRE=30000. Rung 2: XIC T4:1/DN — OTE Fan.
**TOF behaviour:** T4:1/DN = 1 immediately when Motor_Run is TRUE. T4:1 starts counting when Motor_Run goes FALSE. Fan stays ON for 30 s after motor stops.
### Example 7 — RTO: Total Machine Run-Hours Accumulator
**Problem:** Track accumulated machine run-time for preventive maintenance scheduling. Count must survive power loss.
**Ladder:** Rung 1: XIC Machine_Running — RTO T4:2 PRE=3600000. (1 hour = 3,600,000 ms) Rung 2: XIC T4:2/DN — OTE Maintenance_Due_Alarm. Rung 3: XIC Maint_Ack_PB — RES T4:2. (Reset after technician acknowledges service)
**RTO advantage:** Unlike TON, the RTO T4:2.ACC is stored in battery-backed data memory and accumulates across start/stop cycles and power cycles.
## CATEGORY 3: Counter Examples (CTU, CTD)
### Example 8 — CTU: Batch Parts Counter (Reset on Cycle Completion)
**Problem:** Count 100 parts; stop conveyor; reset on new batch start.
**Ladder:** Rung 1: XIC PartSensor — CTU C5:0 PRE=100. Rung 2: XIO C5:0/DN — OTE Conveyor. (Conveyor runs while count < 100) Rung 3: XIC BatchStart_PB — RES C5:0.
**Key point:** The RES rung is as important as the CTU rung. Missing the RES is one of the most common counter errors in student programs.
### Example 9 — CTD: Countdown to Shutoff
**Problem:** A machine must automatically shut down after 50 production cycles. Operator loads 50 as the starting count; machine decrements each cycle and stops at zero.
**I/O Table:** I:0/4 = Cycle_Complete (NO, one pulse per cycle), I:0/5 = Load_PB (NO), O:0/3 = Machine_Enable.
**Ladder:** Rung 1: XIC Load_PB — MOV 50 C5:1.PRE — RES C5:1. (Load preset and clear) Rung 2: XIC Cycle_Complete — CTD C5:1 PRE=50. (Decrement each cycle) Rung 3: XIO C5:1/DN — OTE Machine_Enable. (Run while count > 0)
**CTD behaviour:** C5:1.ACC starts at PRE (50) and decrements toward 0. DN sets when ACC ≤ 0. Machine stops when DN=1.
## CATEGORY 4: Motor Control Ladder Diagrams
### Example 10 — DOL Motor Starter with Overload Protection
**Problem:** Direct-on-line (DOL) motor starter — start/stop with thermal overload protection and fault indication.
**I/O Table:** I:0/0 = Start (NO), I:0/1 = Stop (NC wired → bit=1 at rest), I:0/2 = OL (NC wired → bit=1 healthy), O:0/0 = Motor_KM1, O:0/1 = Fault_Light.
**Ladder:** Rung 1: [XIC I:0/0 || XIC O:0/0] — XIC I:0/1 — XIC I:0/2 — OTE O:0/0. (Motor run with seal-in) Rung 2: XIO I:0/2 — OTE O:0/1. (Fault light ON when OL trips)
**Explanation:** Rung 2 monitors the OL input: when OL trips, I:0/2=0, XIO passes, Fault_Light energises — indicating the overload condition to the operator.
### Example 11 — Forward/Reverse Motor Interlock
**Problem:** Forward/reverse with software and hardware interlocks. (See full solution in ladder-diagram-examples Example 5.)
**Key additions for PLC implementation:** Add a changeover delay TON (200–500 ms) that must elapse between dropping out one direction and energising the other. This prevents contactors from overlapping during rapid direction changes:
**Rung 3 (changeover delay):** XIO Fwd_Run — XIO Rev_Run — TON T4:3 PRE=300. (Start timer only when both de-energised) **Rung 4:** XIC Fwd_Start — XIC T4:3/DN — (rest of Fwd rung). (Fwd cannot start until 300 ms after both drop out)
### Example 12 — Star-Delta Motor Starter Sequence
**Problem:** A 15 kW three-phase motor uses a star-delta starter to limit starting current. Start in star (Y) connection, then after 8 seconds automatically transfer to delta (Δ) connection for full-speed operation.
**I/O Table:** I:0/0 = Start (NO), I:0/1 = Stop (NC wired → bit=1 at rest), I:0/2 = OL (NC wired → bit=1 healthy), O:0/0 = Main_KM1, O:0/1 = Star_KM3, O:0/2 = Delta_KM2; T4:4 = Star_Delta_Timer (TON PRE=8000 ms).
**Ladder:** Rung 1 (main contactor + star): [XIC I:0/0 || XIC O:0/0] — XIC I:0/1 — XIC I:0/2 — OTE O:0/0. (Main contactor, seal-in) Rung 2 (star phase — pre-timer): XIC O:0/0 — XIO O:0/2 — XIO T4:4/DN — OTE O:0/1 — TON T4:4 PRE=8000. (Star ON while main ON, delta NC interlock, timer not done) Rung 3 (delta phase — post-timer): XIC O:0/0 — XIC T4:4/DN — XIO O:0/1 — OTE O:0/2. (Delta ON after 8s, star NC interlock)
**Critical interlocks:** XIO O:0/2 on the star rung prevents star closing while delta is energised. XIO O:0/1 on the delta rung prevents delta closing while star is energised. Both software interlocks AND mechanical interlocks on the contactors are mandatory — a star-delta shorting fault is a three-phase fault.
**Sequence:** Press Start → Main_KM1 energises (Rung 1) → Star_KM3 energises immediately (Rung 2, T4:4/DN=0 so XIO passes) → T4:4 begins counting → after 8 seconds, T4:4/DN=1 → Rung 2: XIO T4:4/DN opens → Star drops out → Rung 3: XIC T4:4/DN passes → Delta_KM2 energises. Open-circuit transition: there is a brief moment (~1 scan) where neither star nor delta is energised — this is normal for open-transition star-delta.
## CATEGORY 5: Process Control Examples
### Example 13 — Tank Level Control with Two Float Switches
**Problem:** Fill pump runs when level is low; stops when level is high. (See full solution in ladder-diagram-examples Example 11.)
**Extended version:** Add a high-high level alarm (a third float switch LS_HiHi at a higher position) that latches an alarm and commands an emergency drain valve:
**Rung 2 (alarm):** XIC LS_HiHi — OTL Hi_Hi_Alarm. **Rung 3 (alarm output):** XIC Hi_Hi_Alarm — OTE Alarm_Light. **Rung 4 (drain valve):** XIC Hi_Hi_Alarm — OTE Drain_Valve. **Rung 5 (alarm reset):** XIC Operator_Ack_PB — XIO LS_HiHi — OTU Hi_Hi_Alarm. (Can only acknowledge once HiHi sensor has cleared)
### Example 14 — ON/OFF Temperature Controller with Hysteresis
**Problem:** Control a chiller using an analog temperature input. Turn ON at 75°C, turn OFF at 70°C.
**Ladder:** See ladder-diagram-examples Example 10 (identical). Key: use OTL/OTU with GEQ/LEQ comparison to implement hysteresis. Do not use a single OTE with GEQ — this produces rapid cycling at the threshold.
## CATEGORY 6: Safety and Interlock Examples
### Example 15 — Two-Hand Control Safety Circuit
**Problem:** A press brake must only cycle when the operator presses BOTH a left-hand button (LH_PB) AND a right-hand button (RH_PB) within 500 ms of each other, ensuring both hands are away from the tooling zone. Both buttons must be held for the full cycle.
**I/O Table:** I:0/0 = LH_PB (NO), I:0/1 = RH_PB (NO), O:0/0 = Press_Cycle; T4:5 = Sync_Window (TON PRE=500).
**Ladder:** Rung 1: XIC LH_PB — TON T4:5 PRE=500. (Start 500ms window when LH pressed) Rung 2: XIC LH_PB — XIC RH_PB — OTE Press_Cycle. (Both must be held) Rung 3: XIO LH_PB — XIO RH_PB — XIC T4:5/DN — OTU Press_Cycle. (If either released before both pressed within window, or if window expired without both, cancel)
**Important:** This software implementation demonstrates the logic concept. A production two-hand control for a Category 3 or 4 safety function per ISO 13849 must use a certified two-hand control safety relay (e.g., Pilz P2HZ, Schmersal SRB 301) — software alone is not sufficient for safety-rated presses.
### Example 16 — Door Interlock with Muting for Material Transfer
**Problem:** A robot cell safety door must stop the robot when open. However, a muting (bypass) function is needed for automated material transfer (when a part enters via conveyor while the door is held open for 5 seconds maximum).
**I/O Table:** I:0/3 = Door_Switch (NC wired → bit=1 when closed), I:0/4 = Mute_Sensor_1 (NO, first part-present sensor), I:0/5 = Mute_Sensor_2 (NO, second part-present sensor), O:0/1 = Robot_Enable; T4:6 = Mute_Timer (TON PRE=5000 ms).
**Ladder:** Rung 1 (mute enable): XIC Mute_Sensor_1 — XIC Mute_Sensor_2 — TON T4:6 PRE=5000. (Both sensors active = material transfer in progress) Rung 2 (robot enable): XIC I:0/3 [|| (XIC T4:6/EN — XIO T4:6/DN)] — OTE Robot_Enable. (Robot runs if door closed OR mute active and timer not expired)
**Explanation:** The parallel mute branch allows the robot to run during material transfer (both sensors active, timer counting) even with the door open. After 5 seconds, T4:6/DN=1, XIO T4:6/DN opens, and the mute branch goes FALSE — forcing the robot to stop if the door remains open.
## CATEGORY 7: Real-World Industrial Examples
### Example 17 — Bottling Plant: Fill, Cap, Label Sequence
**Problem:** A bottling sequence has three stations: (1) Fill station — fill bottle for 3 seconds (TON). (2) Cap station — press cap for 1 second (TON). (3) Label station — apply label for 0.5 seconds (TON). Each station operates sequentially using state bits. An index conveyor advances the bottle between stations on a separate rung.
**I/O Table:** I:0/0 = Start_Cycle (NO PB), I:0/1 = Bottle_Present (NO proximity sensor), O:0/0 = Fill_Valve, O:0/1 = Cap_Press, O:0/2 = Label_Actuator, O:0/3 = Index_Conveyor; B3:0/0 = State_Fill, B3:0/1 = State_Cap, B3:0/2 = State_Label; T4:7 = Fill_Timer (TON PRE=3000), T4:8 = Cap_Timer (TON PRE=1000), T4:9 = Label_Timer (TON PRE=500).
**Ladder:** Rung 1 (start fill): XIC Start_Cycle — XIC Bottle_Present — XIO B3:0/1 — XIO B3:0/2 — OTL B3:0/0. (Enter fill state only if no other state active) Rung 2 (fill): XIC B3:0/0 — TON T4:7 PRE=3000 — OTE Fill_Valve. (Fill for 3s) Rung 3 (fill→cap transition): XIC T4:7/DN — OTU B3:0/0 — OTL B3:0/1 — RES T4:7. (Leave fill, enter cap) Rung 4 (cap): XIC B3:0/1 — TON T4:8 PRE=1000 — OTE Cap_Press. (Cap for 1s) Rung 5 (cap→label transition): XIC T4:8/DN — OTU B3:0/1 — OTL B3:0/2 — RES T4:8. Rung 6 (label): XIC B3:0/2 — TON T4:9 PRE=500 — OTE Label_Actuator. Rung 7 (label→index transition): XIC T4:9/DN — OTU B3:0/2 — RES T4:9 — OTE Index_Conveyor. (Advance conveyor to next position)
**Explanation:** State bits (B3:0/0–2) ensure only one station is active at a time. Each transition rung resets the current state bit (OTU) and sets the next (OTL) atomically. This state-machine pattern scales from 3-station sequences to 30-station lines using the same principle.
## PLC Brand Notation Comparison
The same ladder logic is expressed differently across PLC brands. The table below shows the star-delta main contactor start rung (Example 12, Rung 1) in three major platforms:
**Instruction/Input address format:** - Allen-Bradley Studio 5000: I:0/0 (discrete input, slot 0, bit 0), Q:0/0 or O:0/0 (output). Instructions: XIC, XIO, OTE, OTL, OTU, TON, CTU. - Siemens TIA Portal (LAD): I0.0 (input byte 0, bit 0), Q0.0 (output). Language: LAD. Instructions use standard IEC symbols — same visual appearance as AB. TON called TON with IN, PT (preset), ET (elapsed), Q (done) parameters. Timer preset in TIME format: T#10s instead of integer milliseconds. - Omron CX-Programmer: 0.00 (input channel 0, bit 0), 100.00 (output channel 100, bit 0). Instructions: LD (load NO = XIC equivalent), LD NOT (load NC = XIO equivalent), OUT (= OTE), SET, RESET, TIM (timer, preset in 100ms units: #0100 = 10 s), CNT (counter).
**Same start rung in each brand:** - AB Studio 5000: [XIC I:0/0 || XIC O:0/0] — XIC I:0/1 — XIC I:0/2 — OTE O:0/0 - Siemens TIA Portal: [---| I0.0 |--- || ---| Q0.0 |---] — ---| I0.1 |--- — ---| I0.2 |--- --- (Q0.0) --- - Omron CX-P: LD 0.00 / OR 100.00 / AND 0.01 / AND 0.02 / OUT 100.00
The logical structure is identical across all three — series contacts, parallel branch for seal-in, output coil. Only the address format and instruction naming differ. A competent PLC programmer who knows the logic can work in any platform with one day of instruction on the specific software.
Practise and document any of these examples in circuitdiagrammaker's free online PLC ladder diagram editor — no software installation required, export to SVG or PDF for your technical documentation.
How to wire ladder diagram plc examples
- Choose the right example category for your task Use Category 1–2 (basic logic, timers) for training and exam preparation. Use Category 4 (motor control) for commissioning real motor starters and drives. Use Category 5–6 (process, safety) for process plant projects. Use Category 7 (industrial) for production line design projects.
- Build your I/O allocation table before opening the PLC software Copy the I/O table from the relevant example and adapt it to your project's terminal assignments. If your PLC uses a different slot, adjust the address format. Verify every address against the wiring diagram before downloading.
- Enter the ladder rungs one at a time, testing after each In TIA Portal or Studio 5000, enter Rung 1. Compile (verify) it. Simulate by forcing the relevant inputs and checking the output. Only proceed to Rung 2 when Rung 1 behaves correctly. This incremental approach localises errors to the rung just added.
- Test the star-delta sequence with a timer monitoring window open For Example 12 (star-delta), open a watch table showing: Start input, Motor output, Star output, Delta output, and T4:4.ACC (timer accumulated value). Watch the transition: Star should drop exactly when T4:4/DN sets and Delta should energise on the next scan.
- Verify interlocks by forcing competing inputs simultaneously For forward/reverse (Example 11) and star-delta (Example 12): force both Start inputs TRUE simultaneously in the simulator. Verify that the hardware interlock logic prevents simultaneous contactor energisation in every scenario.
- Adapt the address format for your PLC brand Use the cross-brand notation table above. If working on a Siemens PLC: replace I:0/0 with I0.0, O:0/0 with Q0.0, T4:0 with a named TON function block, and TON PRE=10000 with PT=T#10s. The logic structure stays the same.
- Add the two-hand control timing window for safety circuits For Example 15, verify that the 500ms synchronisation window timer (T4:5) actually resets correctly when LH_PB is released before RH_PB is pressed. Force LH_PB TRUE, wait 600ms (beyond the window), then force RH_PB TRUE — the press should NOT cycle.
- Simulate the bottling sequence through a full cycle and a fault cycle For Example 17: run a complete fill→cap→label→index cycle and verify each state bit is active for the correct duration. Then simulate a fault: force Bottle_Present to 0 mid-fill. Verify the sequence handles the missing bottle correctly (does not proceed without a bottle present).
- Export your ladder diagram for documentation Every deployed PLC program should have a printed or PDF ladder diagram as part of the panel documentation binder. In Studio 5000 or TIA Portal, print to PDF. For design-phase documentation, circuitdiagrammaker.com provides a faster tool for drawing and annotating specific rungs for inclusion in functional design specs.
Specifications
| -| |- (XIC / AB) = -| |- (Siemens LAD) = LD (Omron) | Normally-open contact. TRUE when bit=1. Most common contact in all programs. |
|---|---|
| -|/|- (XIO / AB) = -|/|- (Siemens) = LD NOT (Omron) | Normally-closed contact. TRUE when bit=0. Used for interlocks, fault inhibits, and stop conditions. |
| -( )- (OTE / AB) = -( )- (Siemens) = OUT (Omron) | Output Energize. Non-retentive coil. Bit=1 while rung TRUE. |
| -(L)- (OTL / AB) = -(S)- (Siemens SET) = SET (Omron) | Output Latch / SET. Retentive. Sets bit=1; holds until RESET. |
| -(U)- (OTU / AB) = -(R)- (Siemens RESET) = RESET (Omron) | Output Unlatch / RESET. Clears bit=0. |
| TON (AB) = TON block (Siemens, PT=T#10s) = TIM (Omron, #0100 = 10s) | On-delay timer. DN / Q bit sets when accumulated time ≥ preset. |
| TOF (AB) = TOF block (Siemens) = TIMH (Omron variant) | Off-delay timer. Done bit ON while rung TRUE; starts timing when rung goes FALSE. |
| RTO (AB) = IEC TONR (Siemens) = No direct equivalent (Omron — use program logic) | Retentive timer. ACC holds when enable goes FALSE. Requires RES to clear. |
| CTU (AB) = CTU block (Siemens) = CNT (Omron) | Up-counter. Increments ACC on FALSE→TRUE transition. DN when ACC≥PRE. |
| CTD (AB) = CTD block (Siemens) = CNTR with decrement (Omron) | Down-counter. Decrements ACC. DN when ACC≤0. |
| OSR / ONS (AB) = R_TRIG block (Siemens) = DIFU (Omron) | One-shot rising edge. TRUE for exactly one scan on FALSE→TRUE input transition. |
| GEQ (AB) = GE (Siemens compare block) = >= (Omron CMP) | Greater Than or Equal comparison. TRUE when Source A ≥ Source B. |
| RES (AB) = RES (within TON/CTU reset input in Siemens) = CNR (Omron reset) | Reset instruction. Clears timer or counter ACC to 0 and resets DN bit. |
| AB address format | Discrete input: I:slot/bit (I:0/0). Discrete output: O:slot/bit (O:0/0). Integer: N7:element. Timer: T4:number. Counter: C5:number. |
| Siemens TIA Portal address format | Discrete input: I byte.bit (I0.0). Discrete output: Q byte.bit (Q0.0). Data blocks: DB1.DBX0.0. Timer preset: TIME type, e.g. T#10s. |
| Omron address format | Discrete input: channel.bit (0.00). Discrete output: 100.00. Timer preset: #BCD value (#0100 = 10.0 s in 0.1 s units). Counter: C000 to C127. |
Safety warnings
- Star-delta contactor interlocks (Example 12): the software XIO cross-interlock is necessary but not sufficient. A mechanical interlock (auxiliary contact of each contactor wired to inhibit the coil of the other) must be added at the hardware level. The mechanical interlock prevents both contactors closing if the PLC scans an intermediate state during a rapid changeover.
- Two-hand safety controls (Example 15): the ladder logic shown is for educational demonstration only. Any two-hand control on a production machine classified as a serious injury hazard (presses, bending brakes, shears) must use a Type IIIC or equivalent two-hand control relay (IEC 60947-5-8) implemented in a dedicated safety controller, not a standard PLC program rung.
- All E-stop and safety guard circuits must be hardware-wired NC and routed through safety relays or a certified safety PLC before reaching the PLC's standard input module. A program fault, online edit error, or I/O module failure in a standard PLC will not reliably maintain a safety function. Use GuardLogix (Allen-Bradley), CPU 1516F (Siemens), or equivalent safety-rated hardware for SIL/PLd applications.
- Before commissioning any star-delta, DOL, or forward/reverse program on real motor hardware: verify all three-phase power circuit wiring, all control wiring against the I/O table, and perform a controlled test run at no-load before connecting the driven equipment.
Tools needed
- Allen-Bradley Studio 5000 or RSLogix 500 — for AB CompactLogix / ControlLogix / MicroLogix. 30-day trial available from Rockwell Automation. Includes RSLogix Emulate for offline simulation.
- Siemens TIA Portal — for S7-1200, S7-1500, S7-300/400. 21-day full trial; PLCSIM for simulation without hardware. Covers all industrial Siemens PLC platforms.
- OpenPLC — free, open-source, IEC 61131-3 compliant, includes software PLC simulator. Best free tool for practising all examples in this guide.
- circuitdiagrammaker.com — free browser-based ladder diagram editor. Draw and annotate rungs from any example, export as SVG or PDF. No installation required.
- Spreadsheet for I/O allocation tables — create a template with columns: PLC Address, Tag Name, Signal Type (NO/NC), Field Device Description, Safety Note.
- Three-phase motor control test bench (or simulation) — for star-delta and DOL examples: a physical test bench with motor, contactors, and overload relay validates the real-world behaviour that simulation cannot fully replicate.
Common mistakes
- Omitting the star/delta mutual interlock contacts in star-delta starter programs — if both contactors close simultaneously, the result is a three-phase short circuit. Both software XIO interlocks AND mechanical interlocks are mandatory.
- Using TON PRE in the wrong time units — entering PRE=10 expecting 10 seconds when the platform uses milliseconds (giving 10 ms instead). Always verify the time base: modern PLCs typically default to 1 ms; older Allen-Bradley uses 0.01 s or 1.0 s time base options.
- Not including a changeover delay between forward and reverse contactors — even with correct software interlocks, the physical contactor dropout time (20–50 ms) may allow a brief overlap if the scan cycle is fast. Add a 200–500 ms delay TON.
- Building a two-hand safety circuit in standard ladder logic for a legally classified dangerous machine — Category 3/4 safety functions require certified hardware. Document this distinction clearly in your functional design specification.
- Missing the ONS (one-shot) instruction on a counter enable contact — the sensor dwell time may span multiple scans, causing multiple increments per physical part. Always use ONS with CTU inputs connected to field sensors.
- In the bottling sequence, not using state bits to ensure mutual exclusion — without state bits (OTL/OTU), multiple station timers can run simultaneously if the start conditions overlap, producing a corrupted sequence.
Troubleshooting
- Star-delta motor trips on overload relay during the star-to-delta transition
- Cause: The transition current spike (open-circuit transition creates a brief high-current pulse when reconnecting in delta) trips the thermal overload. The overload is set too sensitively, or the transition is happening before the motor has reached near-synchronous speed in star. Fix: Increase the star phase timer (T4:4 PRE) to allow the motor to accelerate more fully before transitioning. Typical values: 5–15 seconds depending on motor inertia and load. Also check that the OL relay is set to 1.0x motor FLA, not 0.9x. Consider using a closed-transition star-delta panel if the load is high-inertia.
- Bottling sequence: all three station outputs turn on simultaneously at program start
- Cause: State bits (B3:0/0–2) are all 0 at startup, and the Start_Cycle rung lacks sufficient interlock to prevent multiple states from enabling at once, or the OTL bits from a previous run are still set in battery-backed memory. Fix: Add a first-scan initialisation rung that sends OTU to all state bits (B3:0/0, B3:0/1, B3:0/2) and resets all timers on the first scan after PLC power-up. Use the PLC's system first-scan bit for this rung.
- Two-hand control (Example 15) activates with only one button pressed
- Cause: The synchronisation window timer storage bit is not being used correctly, or the ONS storage bit for one button is shared with another instruction, causing spurious triggering. Fix: Verify that the timing window logic correctly inhibits the output if both buttons are not simultaneously active. Use a watch table to monitor LH_PB, RH_PB, Press_Cycle, and T4:5.ACC simultaneously. Ensure each ONS instruction has a unique, dedicated storage bit.
- CTU counter increments to values greater than PRE without stopping the conveyor
- Cause: CTU.ACC can continue incrementing beyond PRE — the DN bit sets at PRE and stays set, but the ACC keeps counting. If the RES rung resets the counter at the wrong time, DN clears, the conveyor restarts, and counts past PRE before the next RES. Fix: Verify that the CTU PRE is correct and that the XIO C5:0/DN contact on the conveyor rung is not accidentally being bypassed. Add a check: XIC C5:0/DN — OTE Stop_Alarm to flag when the count has reached or exceeded PRE, as a diagnostic aid.
- Forward/reverse changeover delay (Example 11 extended) causes motor to not restart after direction change
- Cause: The changeover delay TON's enable rung requires BOTH Fwd_Run AND Rev_Run to be 0. If either flag is not being cleared cleanly (e.g., a latched bit not resetting), the timer never starts and the interlock never releases. Fix: Monitor Fwd_Run, Rev_Run, and T4:3.ACC in a watch table during the changeover. Verify both flag bits go to 0 when the direction change is commanded. If not, check that the OTE rungs for the direction flags are de-energising when their enable conditions clear.
Frequently asked questions
What are the most common PLC ladder logic examples used in industry?
The five patterns found in virtually every industrial PLC program are: (1) start/stop motor seal-in circuit, (2) forward/reverse interlock, (3) TON-controlled timed enable/disable, (4) CTU batch counter with reset, and (5) two-float-switch tank level controller. Beyond these fundamentals, star-delta motor starters, E-stop safety circuits, and sequential state machines appear in the majority of manufacturing and process plants.
How does a star-delta starter ladder diagram work?
A star-delta starter reduces motor starting current by first connecting the motor windings in a star (Y) configuration, which applies only 1/√3 (about 58%) of rated voltage across each winding, reducing starting current to approximately 1/3 of direct-on-line value. After a timed delay (typically 5–10 seconds), the star contactor opens and the delta contactor closes, reconnecting the windings in delta for full-voltage operation. The ladder program: Rung 1 starts the main contactor and seal-in; Rung 2 energises the star contactor and runs a TON timer (with a NC delta interlock); Rung 3 energises the delta contactor when the timer's DN bit sets (with a NC star interlock).
What is the difference between DOL and star-delta starter in a ladder diagram?
A DOL (Direct On Line) starter ladder program has one output (the motor contactor) controlled by a start/stop seal-in rung — typically 1–2 rungs. A star-delta starter requires three outputs (main, star, delta contactors), a TON timer, and mandatory cross-interlocks between the star and delta rungs — typically 4–6 rungs minimum. The star-delta program adds the timer-controlled transition logic and the critical mutual interlock that prevents star and delta contactors from closing simultaneously.
How do I program a two-hand safety circuit in ladder logic?
A basic software two-hand control uses: (1) a synchronisation window TON timer that starts when the first button is pressed, (2) an AND rung that requires both buttons simultaneously for the output, and (3) a cancel rung that inhibits the output if the window timer expires before both buttons are pressed. Note: for a safety-rated two-hand control (Category 3/4 per ISO 13849), the logic must be implemented in a certified safety relay or safety PLC — software alone in a standard PLC is not sufficient for legally compliant safety functions on presses and forming machines.
What PLC programming examples are best for a beginner?
Start in this order: (1) AND logic — two series contacts, one output. (2) OR logic — two parallel contacts, one output. (3) Start/stop seal-in circuit. (4) TON timer with DN output. (5) CTU counter with reset. These five examples, practised until you can write them from memory without reference, give you the foundation for 80% of real industrial programs. Every other example in this guide builds on these five fundamentals.
How are counters reset in PLC ladder logic?
Using a RES (Reset) instruction on a separate rung. The RES rung is enabled by whatever condition should restart the count — a batch-start pushbutton, a cycle-complete signal, a maintenance-mode selector, or a first-scan initialisation bit. The RES clears the counter's accumulated value (ACC) to 0 and resets its Done (DN) bit. Without a RES rung, the counter reaches its preset on the first batch and never resets — a common student programming error.
What is an I/O allocation table and why is it needed?
An I/O allocation table is a document listing every PLC input and output address, its tag name, hardware wiring type (NO or NC), and a plain-language description of the connected field device. It is needed because: (1) it forces you to think about fail-safe wiring before writing any rungs, (2) it is the reference document for electricians wiring the panel, (3) it enables you to write the correct contact type (XIC vs XIO) for each signal, and (4) it is required by most industrial standards as part of the functional design specification.