exercises · South Africa
PLC conveyor program with start, stop and e-stop
A PLC conveyor program done right: seal-in start-stop, pull-wire e-stop handling, a 3-second pre-start warning horn, ladder steps and the ST equivalent.
Difficulty: beginner · 20–40 minutes
This is a build-along exercise, not a reading page. You get a short job card of the kind a contractor actually receives, an I/O table to wire against, and a worked solution to check yourself with once your own version runs — plus the test sequence that proves it, because a program you haven't tried to break is a program you haven't tested. Sketch first, build second, test third. Same order as on site.
Open the simulator and build along →The job card
Job card: the flour intake conveyor at a Cape Town bakery runs 18 metres from the tipping bay into the silo room, and for most of that run the operator cannot see the far end. The safety file requires a pull-wire e-stop along the full length and a horn that sounds for 3 seconds before the belt moves, so anyone leaning over the belt gets warned. Start and stop stations are at the tipping bay. After an e-stop, resetting the pull-wire alone must not restart the belt — someone has to walk back and press start. Build the logic and prove all three stop paths.
Read it the way a foreman hands it to you. Every requirement on that card is a test case: when you think the program is done, walk the card line by line and force each condition in the watch table. Any line without a matching test you actually ran means you're not done yet. That habit — card in one hand, watch table in the other — is what separates a programmer who commissions clean from one who gets the call-back at month end.
I/O assignment
Wire your simulator project to this table exactly. Half the value of an exercise like this is tag discipline: name the points the same way the table does and the solution steps further down will read straight onto your rungs without translation.
| Tag | Type | Address | Purpose |
|---|---|---|---|
StartPB | DI | %I0.0 | Start pushbutton at the tipping bay, normally open, momentary. |
StopPB | DI | %I0.1 | Stop pushbutton, normally closed, wired fail-safe. TRUE = healthy and unpressed. |
EstopOK | DI | %I0.2 | Pull-wire e-stop switch contact, normally closed, fail-safe. TRUE = wire taut and switch reset; a pulled wire, a tripped switch or a broken cable all read FALSE. |
ConveyorRun | DO | %Q0.0 | Conveyor motor contactor coil, 5.5 kW belt drive. |
StartHorn | DO | %Q0.1 | Pre-start warning horn, sounds for the 3 seconds before the belt moves. |
A note on the Type column: DI is a digital input, DO a digital output, AI and AO are analogue in and out, and M is an internal memory bit that never leaves the CPU. The addresses use IEC notation (%I, %Q, %M). If your head is in Allen-Bradley land, map %I0.0 to I:0/0 and carry on — the logic doesn't change, only the spelling of the addresses.
Think before you build
Don't open the ladder editor yet. The notes below are the design decisions that determine whether your program works first time or fights you for an hour. Read them, then sketch the rung shapes on paper. Pencil and the back of a delivery note is fine — most working programs start exactly there.
- Split the logic into a run-request seal-in and a delayed motor output. The seal-in answers 'should the belt be running'; the TON answers 'has the horn finished'. Mixing the two into one rung makes the horn time interfere with the stop logic.
- The e-stop contact sits in the seal-in rung exactly like the stop button, so tripping it kills the request. Because restarting needs the start button, resetting the pull-wire can never move the belt by itself — that behaviour falls out of the seal-in structure for free.
- A pull-wire that goes slack, a cut cable and a pressed e-stop must all stop the belt. NC fail-safe wiring gives you all three with one input; this is why the job spec says normally closed, not a programming preference.
Step-by-step solution
Build one rung at a time and test after every rung. Never write the whole program and then test the lot — when five rungs go in untested and the machine misbehaves, you're debugging five suspects instead of one. The steps below follow that order. In the pseudo-rungs, ] [ is a normally-open examine, ]/[ is normally-closed, and ( ) is the output coil.
Rung 1: run request with both stops in series
Standard seal-in: StartPB in parallel with a RunReq contact, in series with StopPB and EstopOK contacts, driving an internal RunReq bit. Use a memory bit here, not the motor output — the belt itself must not move yet.
// ──┬──[ ]StartPB──┬──[ ]StopPB──[ ]EstopOK──( )RunReq
// └──[ ]RunReq───┘
Rung 2: the 3-second horn timer
A TON with IN driven by RunReq and PT of T#3s. The timer starts the instant the request seals in and its done bit becomes the permission for the motor. If anyone stops the belt, RunReq drops, the TON resets, and the next start gets a fresh full-length horn.
// RunReq ──[TON tHorn, PT := T#3s]
Rungs 3-4: horn and motor outputs
The horn sounds while the request is in but the timer is not done: RunReq AND NOT tHorn.Q. The motor runs on RunReq AND tHorn.Q. Between them the two rungs cover every instant of a start cleanly — horn first, then belt, never both off while requested.
// Rung 3: RunReq AND NOT tHorn.Q ──( )StartHorn
// Rung 4: RunReq AND tHorn.Q ──( )ConveyorRun
Test all three stop paths
Force StartPB and watch the horn run exactly 3 seconds before ConveyorRun picks up. Then prove each stop: StopPB during the horn phase (belt must never start), StopPB while running, and EstopOK forced FALSE while running. After the e-stop test, force EstopOK back to TRUE and confirm the belt stays dead until StartPB is pressed again.
The structured text version
The same logic in IEC 61131-3 structured text — each output written as a boolean equation you can read aloud.
(* Conveyor with pre-start horn, IEC 61131-3 ST *)
RunReq := (StartPB OR RunReq) AND StopPB AND EstopOK;
tHorn(IN := RunReq, PT := T#3s);
StartHorn := RunReq AND NOT tHorn.Q;
ConveyorRun := RunReq AND tHorn.Q;
Ladder wins this argument when an electrician has to fault-find your program at 02:00 with a multimeter mindset — the rung looks like the circuit diagram it replaced, and that familiarity is worth real money on a breakdown. ST starts winning when the pattern repeats: ten pumps with the same interlock shape is one ST function called ten times, where ladder hands you ten near-identical rungs to keep in sync by hand forever. Learn both. Build the exercise in ladder first, then write the ST version and confirm the two behave identically in the simulator. That translation skill — same logic, two languages — is exactly what technical interviews and commissioning work both test.
Common mistakes
Every mistake below comes from a real program: either one of ours from years back, or one we were called in to fix. Check your build against the list before you call the exercise done.
- Putting the horn delay on the start button instead of on the run request. Then the operator has to hold the button in for 3 full seconds, and the first one who lets go early logs a fault call for a belt that 'sometimes refuses to start'.
- Treating the e-stop as just another stop and letting its reset restart the belt. The seal-in must require a fresh start command after any e-stop — a belt that lurches alive when someone re-tensions the pull-wire is how fingers get taken.
- Driving the horn from its own separate timer chain that does not reset with the request. A stop during the horn phase then leaves a horn timer mid-count, and the next start gets a clipped 1-second warning instead of 3.
- Relying on the PLC alone for the e-stop on the real machine. In this exercise the input is the whole story; on site the pull-wire also breaks the contactor circuit through a safety relay, and the PLC input is for status and restart logic.
Most of these share one root cause: the rung shape doesn't match the intent, so the program passes the obvious test and fails the edge case. That's why the solution steps force the edge cases deliberately instead of stopping at "it starts and it stops". Steal that habit for every program you write from here on.
Take it further
Got it working first time? Good — now make it earn its keep. Each extension below changes the spec the way a real client does: after you've finished. Treat each one as a fresh job card, and re-test the whole program afterwards, not just the new part. Regressions hide in the rungs you didn't touch.
- Add a belt-speed sensor input and trip the conveyor if no pulses arrive within 5 seconds of the contactor closing — a slipping or snapped belt looks exactly like a running one from the panel.
- Add a second conveyor feeding this one and sequence the starts: downstream belt first, 5 seconds apart, upstream first on stop. The staggered motor start exercise covers the timing pattern.
- Latch an e-stop-tripped flag that flashes a beacon until a supervisor key-switch input acknowledges it, borrowing the flasher from the timer exercise.
If you build even one extension, screenshot the finished rungs and keep them somewhere organised. A folder of working, tested exercise solutions is the start of a portfolio — and hiring engineers ask candidates to explain a rung far more often than they ask to see certificates.
Run this in the simulator
Every beginner exercise on this site, this one included, runs on the simulator's free tier — no card details, no install, signed up and on a rung inside two minutes. The watch table is the part that matters here: force the inputs, watch the outputs, and run the test sequence from the solution steps against a live scan cycle instead of imagining it. The full curriculum — the structured version of these exercises with feedback on every submission — plus the wiring track, sensor school and cert packs sit in the Basic tier at USD 12 per month and Pro at USD 29 per month. Training centres and engineering departments wanting this in a lab should look at the Teams tier (USD 199 per seat per year, minimum 5 seats); the training-centres page carries the institutional details and the contact form. If you're an individual learning the trade, start on the free tier, finish the beginner set, and decide from there.
Run this exercise on the free tier →Reference
Ladder logic on Wikipedia covers the background theory behind this exercise, and it's worth twenty minutes of your time after the build — theory sticks better once your hands have done the work. The languages used here are defined by the IEC 61131-3 standard from iec.ch, and your CPU vendor's manual remains the canonical source for how a specific controller executes them.
What we don't claim
This site is not SAQA-registered, not MerSETA-accredited, and not an NQF-registered qualification provider. Our completion certificates are course-level only — they describe what you covered, not an NQF Level X qualification. The CCST cert from ISA is the portable industry credential we recommend; we are not an ISA cert delivery partner either, but our cert packs are CCST-aligned. The exercise on this page is practice material written by working programmers: finishing it proves the skill to yourself and to the simulator's progress tracking, not to a regulator.