Conveyor Belt PLC Ladder Diagram (Run It Free Online)
This page covers the full conveyor belt PLC ladder diagram — from the start/stop seal-in rung through photo-eye height sorting, CTU object counting, and two-belt interlock logic. Every diagram below is grounded in a live scenario you can run directly in your browser: write the ladder, watch boxes travel, and get instant pass/fail feedback — no PLC hardware, no software install.
counterssensorstiming
Ready to build this?
Sign up free — no credit card required. This scenario requires the Pro plan.
Boxes travel along a main conveyor. An entry photo-eye announces each arriving box. A second photo-eye mounted at a known height differentiates tall boxes from short ones. Tall boxes must be diverted onto a second conveyor by firing a pneumatic solenoid while the box is passing the diverter arm; short boxes continue past undisturbed. A counter watches the divert lane's limit sensor and lights a lamp once five tall boxes have been successfully diverted.
Objectives
START energises MAIN_MOTOR; STOP de-energises it
Fire DIVERTER_SOL so that tall boxes are pushed onto the divert lane
Leave DIVERTER_SOL off for short boxes
Light TALL_COUNT_LAMP once 5 tall boxes have cleared the divert-lane limit sensor
Never energise DIVERTER_SOL while ENTRY_PE is still broken — the arm would collide with the box
Hints
Use SET/RESET on MAIN_MOTOR driven by START (set) and STOP (reset)
SET DIVERTER_SOL on HEIGHT_PE and RESET it on DIVERT_LIMIT — the belt spacing guarantees ENTRY_PE has already cleared before HEIGHT_PE fires
Count DIVERT_LIMIT rising edges with a CTU (PV := 5) and drive TALL_COUNT_LAMP from its Q output
SHORT_COUNT_LAMP is an optional extension — the 5 test cases only require MAIN_MOTOR, DIVERTER_SOL, TALL_COUNT_LAMP, and the ENTRY_PE safety invariant
I/O Table
Inputs
START
Start push-button (momentary)
BOOL · %I0.0
STOP
Stop push-button (momentary)
BOOL · %I0.1
ENTRY_PE
Entry photo-eye (beam broken by any box)
BOOL · %I0.2
HEIGHT_PE
Height photo-eye (beam broken by tall boxes)
BOOL · %I0.3
DIVERT_LIMIT
Divert-lane limit sensor
BOOL · %I0.4
Outputs
MAIN_MOTOR
Main conveyor motor contactor
BOOL · %Q0.0
DIVERTER_SOL
Pneumatic diverter solenoid
BOOL · %Q0.1
TALL_COUNT_LAMP
Tall-box count ≥ 5 indicator
BOOL · %Q0.2
SHORT_COUNT_LAMP
Short-box count ≥ 5 indicator
BOOL · %Q0.3
Your program will be tested against:
All test cases run automatically when you submit. Assertions are hidden until you pass.
#1Start energises main motor, stop drops it
START -> MAIN_MOTOR on; STOP -> off
#2Tall box fires the diverter solenoid and is diverted
Inject a tall box: solenoid pulses for the transit window, box reaches the divert lane
#3Short box passes without firing the diverter
Inject a short box: diverter solenoid remains off throughout the run
#4Five tall boxes light TALL_COUNT_LAMP
Five tall boxes are injected spaced apart; TALL_COUNT_LAMP energises after the fifth is diverted
#5Diverter never fires while a box still breaks the entry beam
Inject a tall box; assert the solenoid was never energised while ENTRY_PE was active
How a conveyor belt PLC program works
A conveyor belt PLC control system manages a motor-driven belt that moves product from one point to another. At its core every conveyor PLC program does three things: it starts and latches the motor when an operator presses Start, it stops the motor safely when Stop or an overload condition is triggered, and it tracks objects moving past sensors so it knows how many items have been processed and whether they need to be diverted.
The typical sequence works like this. An operator presses the Start push-button, which is wired as a normally-open (NO) momentary contact to input I0.0. The PLC ladder program latches this Start command using a seal-in contact — a parallel branch from the motor's own output bit that holds the motor coil energised after the Start button is released. The motor contactor pulls in, the belt begins to move, and product starts flowing past the sensors downstream.
Safety is handled by normally-closed (NC) contacts wired in series with the motor coil rung. The Stop push-button, thermal overload relay, and emergency stop are all wired NC at the field terminal. If any of these open — whether by operator action, thermal trip, or a broken wire — the input signal drops and the motor coil de-energises immediately. This is the fail-safe principle: the safe state (motor off) is reached by losing the signal, not by applying one.
In the Conveyor Sort scenario, five inputs are pre-wired for you: START (%I0.0), STOP (%I0.1), ENTRY_PE (%I0.2, entry photo-eye), HEIGHT_PE (%I0.3, height-discrimination photo-eye), and DIVERT_LIMIT (%I0.4, divert-lane limit sensor). Three outputs are pre-wired: MAIN_MOTOR (%Q0.0), DIVERTER_SOL (%Q0.1, pneumatic diverter solenoid), and TALL_COUNT_LAMP (%Q0.2).
I/O assignment table for the Conveyor Sort scenario. Five inputs (START, STOP, ENTRY_PE, HEIGHT_PE, DIVERT_LIMIT) and three outputs (MAIN_MOTOR, DIVERTER_SOL, TALL_COUNT_LAMP) — all pre-wired.
Start/stop seal-in — the foundation of every conveyor PLC program
The start/stop motor control rung is the single most commonly written piece of PLC ladder logic in existence. Every motor-driven machine — conveyor, pump, fan, compressor — uses this same pattern. Master it once and you have the foundation for almost every industrial PLC program.
The rung begins with two parallel branches feeding a single series path. Branch A is XIC START (I0.0) — the momentary push-button. Branch B is XIC MAIN_MOTOR (Q0.0) — the seal-in contact. Both branches connect to a series chain of normally-closed contacts: XIO STOP (I0.1). At the end is OTE MAIN_MOTOR (Q0.0).
When you press Start, branch A goes true. MAIN_MOTOR coil energises. On the same scan, MAIN_MOTOR (Q0.0) is now true, so branch B closes — even after you release Start and branch A goes false, branch B holds the rung true. The motor stays on. This is the seal-in latch, also called a holding contact or memory rung.
In the Conveyor Sort scenario the hints guide you to use SET/RESET coils on MAIN_MOTOR instead of the parallel seal-in pattern — both produce identical behaviour. SET MAIN_MOTOR on the START rising edge; RESET MAIN_MOTOR on the STOP rising edge. The SET/RESET approach is cleaner to read when multiple conditions can stop the motor, because each stop condition gets its own RESET rung rather than being piled into one long series chain.
Conveyor belt PLC start/stop ladder diagram: Start push-button with MAIN_MOTOR seal-in contact and STOP NC contact in series with the motor contactor coil.
Photo-eye sensor sequence — detecting and sorting boxes by height
The Conveyor Sort scenario adds two photo-eyes to the standard start/stop program, which is what makes it a plc conveyor belt project rather than just a motor control exercise. The ENTRY_PE at the belt entrance detects any box arriving on the main conveyor — tall or short. The HEIGHT_PE, mounted at a fixed height above the belt, only has its beam broken by tall boxes.
The sensor sequence diagram shows the timing relationship between these two photo-eyes as a tall box travels down the belt. ENTRY_PE fires first as the box reaches the belt entrance. While ENTRY_PE is still active (beam broken), the box has not yet reached HEIGHT_PE. The belt spacing guarantees that ENTRY_PE clears before HEIGHT_PE fires — this is the safety invariant that your ladder logic must preserve.
When HEIGHT_PE fires, it means a tall box is passing the height sensor. This is the correct moment to energise DIVERTER_SOL, which extends a pneumatic arm to push the box onto the divert lane. DIVERTER_SOL stays energised until DIVERT_LIMIT fires — the limit sensor at the entrance of the divert lane confirms the box has been successfully pushed across. At that point your ladder should RESET DIVERTER_SOL.
If HEIGHT_PE does not fire as a box passes, the box is short. DIVERTER_SOL must remain off for the entire transit — the short box continues straight along the main conveyor to the end. This is verified by the 'short-box-passes' test case in the auto-grader, which injects a short box and asserts DIVERTER_SOL stays false throughout.
Sensor sequence for the Conveyor Sort scenario: ENTRY_PE fires first, then HEIGHT_PE fires only for tall boxes. DIVERTER_SOL energises on HEIGHT_PE and de-energises on DIVERT_LIMIT.
Object counting with CTU — lighting the lamp after five tall boxes
Once the diverter is working, the next objective in conveyor belt plc programming examples is counting: light TALL_COUNT_LAMP when five tall boxes have been successfully diverted. This is a textbook CTU (count up) counter application.
Add a CTU counter rung. The count-up (CU) input is driven by a contact for DIVERT_LIMIT — use a rising edge detector (R_TRIG) on DIVERT_LIMIT so the counter increments exactly once per box, not once per scan while DIVERT_LIMIT is active. Gate it with the MAIN_MOTOR run bit (Q0.0) so counting only occurs while the belt is moving. Set the preset (PV) to 5. When CTU.ACC reaches 5 the done bit (CTU.Q in IEC notation, CTU.DN in Allen-Bradley) goes true — wire this bit to TALL_COUNT_LAMP (Q0.2).
The critical detail is edge detection. DIVERT_LIMIT is a level signal — it stays true for as long as the box is physically in contact with the limit sensor. Without an R_TRIG, the counter would increment on every scan while DIVERT_LIMIT is active, which on a 10 ms scan cycle over a 200 ms sensor pulse would add 20 spurious counts. The R_TRIG converts the level to a single one-shot pulse, giving you exactly one count per box.
The auto-grader's 'counter' test case injects five tall boxes spaced seven seconds apart and checks that TALL_COUNT_LAMP is off after the fourth box and on after the fifth. It also checks tallDivertedCount in the physics engine, confirming the boxes were physically diverted — not just counted.
CTU counting rung for the Conveyor Sort scenario: DIVERT_LIMIT rising edge (R_TRIG) gated by MAIN_MOTOR drives CTU with PV = 5. CTU.Q drives TALL_COUNT_LAMP when five tall boxes have been diverted.
Two-belt interlock — sequence logic for conveyor plc conveyor motor ladder logic
Most real conveyor installations consist of two or more belts in series. A feeder belt loads product onto a main transfer belt. The transfer belt delivers to a packaging or palletising station. In this configuration, Belt 2 (downstream) must never start before Belt 1 (upstream) is already running — if Belt 2 starts first, when Belt 1 does start it will pile product onto a stationary Belt 2, causing a jam.
The sequence interlock rung enforces this dependency in the PLC ladder program. It is a single additional contact added to Belt 2's start circuit: a normally-open XIC contact referencing Belt 1's motor output bit (Q0.0). If Belt 1 is not running — Q0.0 is false — the XIC contact is open and Belt 2's start rung cannot become true regardless of whether Belt 2's Start button is pressed.
This also means: if Belt 1 stops mid-operation (overload trip, E-stop, operator Stop), Belt 2 will also stop automatically on the same scan. This is correct behaviour — if the upstream belt stops, running the downstream belt would soon exhaust the product already in transit and then run empty, potentially causing downstream jams.
Three-belt or four-belt lines follow exactly the same pattern — each belt's start rung includes an XIC contact for every upstream belt. Belt 3 requires both Belt 1 and Belt 2 to be running. This creates a chain of dependencies that enforces the correct startup order automatically, regardless of how quickly the operator presses start buttons. The PLC enforces the sequence; the operator cannot circumvent it. This is the key safety benefit of plc conveyor motor ladder logic over relay-based control.
Two-conveyor sequence interlock rung: Belt 2 start circuit includes a normally-open XIC Belt1_Motor contact. Belt 2 cannot energise unless Belt 1 is already running.
Troubleshooting your conveyor belt PLC program
When a conveyor PLC program misbehaves, the root cause is almost always in the seal-in circuit, the sensor edge detection, or the safety invariant around the diverter solenoid. Here are the most common faults you will encounter in the Conveyor Sort scenario and in real conveyor control system using plc installations.
**Motor won't start or doesn't latch.** The MAIN_MOTOR rung goes true for one scan when START is pressed but drops false on the next because the seal-in contact is missing or referencing the wrong tag. Verify the ladder has a parallel XIC MAIN_MOTOR (Q0.0) contact around the START contact, or that you are using SET/RESET correctly. If using SET, confirm the coil tag matches the output address exactly.
**DIVERTER_SOL fires on short boxes.** The HEIGHT_PE contact in the solenoid rung is XIO (normally-closed) instead of XIC (normally-open), or the rung logic is inverted. HEIGHT_PE should energise the solenoid only when the photo-eye beam is broken by a tall box — use XIC HEIGHT_PE.
**Diverter safety invariant violated — solenoid fires while ENTRY_PE is still active.** The auto-grader's 'timing-invariant' test case checks the physicsKey 'divertWhileEntryViolation'. This violation means your solenoid is energising before ENTRY_PE clears. The correct implementation is to SET DIVERTER_SOL on HEIGHT_PE (not on ENTRY_PE) — the scenario's belt spacing guarantees ENTRY_PE has already cleared by the time HEIGHT_PE fires for any tall box.
**Counter not incrementing.** Either no R_TRIG is present on the DIVERT_LIMIT input (the CTU receives a level rather than an edge and may increment erratically), or the MAIN_MOTOR gate contact is false because the motor is not running when boxes are injected. Start the motor before injecting boxes in the test sequence.
**TALL_COUNT_LAMP never lights.** The CTU done bit (CTU.Q or CTU.DN depending on dialect) is not wired to TALL_COUNT_LAMP. Confirm the output rung references the CTU instance's done output, not the CU input or the accumulator value.
Frequently asked questions
What ladder logic instructions are used for conveyor belt PLC control?
A conveyor belt PLC program uses XIC (examine if closed) and XIO (examine if open) contacts for start/stop and interlock logic, an OTE (output energise) or SET/RESET coil for the motor contactor, and a CTU (count up) counter instruction for object counting. The start/stop circuit uses a parallel XIC seal-in contact — or a SET coil on the start edge — to latch the motor on after the momentary Start button is released. Normally-closed XIO contacts on Stop and Overload inputs provide fail-safe protection.
How do I sort boxes by height in a PLC conveyor program?
Use two photo-eyes: an entry photo-eye (ENTRY_PE) that detects any box and a height photo-eye (HEIGHT_PE) mounted at a fixed height that only sees tall boxes. When HEIGHT_PE fires, SET the diverter solenoid. When the divert-lane limit sensor fires (confirming the box has been pushed across), RESET the solenoid. The critical safety rule is never energise the solenoid while ENTRY_PE is still active — the belt spacing in a correctly designed system guarantees ENTRY_PE clears before HEIGHT_PE fires for any tall box.
How do I add object counting to a conveyor PLC program?
Add a CTU (Count Up) counter rung. Use an R_TRIG (rising-edge detector) on the divert-lane limit sensor contact as the CU input so the counter increments exactly once per box, not once per scan. Gate the rung with the motor run bit so counting only occurs while the belt is moving. Set the preset (PV) to the target count — for example 5. When CTU.ACC reaches PV the done bit (CTU.Q in IEC, CTU.DN in Allen-Bradley) goes true, which you wire to a lamp or alarm output.
How does a conveyor interlock work in ladder logic?
A conveyor sequence interlock ensures a downstream belt (Belt 2) cannot start until the upstream belt (Belt 1) is already running. Add a normally-open XIC contact referencing Belt 1's motor output bit in series with Belt 2's start circuit. If Belt 1 is not running, the XIC contact is open and Belt 2 cannot energise no matter how many times Belt 2's Start button is pressed. This also means Belt 2 stops automatically if Belt 1 trips — preventing product pile-ups at the transfer point.
Can I simulate a conveyor belt PLC program without hardware?
Yes. The Conveyor Sort scenario on this page runs directly in your browser — write the ladder logic, press Run, and watch simulated boxes travel along the belt. The physics engine moves boxes at a realistic belt speed, fires the photo-eye inputs at the correct positions, and the auto-grader checks your seal-in latch, diverter timing invariant, CTU counter, and TALL_COUNT_LAMP logic. No physical PLC, motor, or sensor required.
What is the timing invariant for the diverter solenoid in a conveyor sort program?
The diverter solenoid must never be energised while the entry photo-eye beam is still broken by a box. If the solenoid extends while a box is still partially over the diverter arm's pivot point, the arm collides with the box and causes a mechanical jam. The safe implementation is to SET the solenoid only when HEIGHT_PE fires — by which time the entry photo-eye has already cleared — and RESET it when DIVERT_LIMIT fires. The auto-grader verifies this invariant in the 'timing-invariant' test case.