PLC Programming SAPLC ProgrammingSOUTH AFRICA
Menu

plc-programming-examples · South Africa

PLC Programming Examples: 20 Ladder Logic Projects

PLC programming examples for beginners: 20 ladder logic projects with I/O lists, test cases, failure modes and graded browser simulator practice online.

PLC programming examples system map connecting field inputs, control logic, outputs and feedback testing
PLC programming examples system map connecting field inputs, control logic, outputs and feedback testing

PLC programming examples are most useful when they include more than a finished ladder diagram. A good example gives you the process requirement, I/O list, expected sequence, abnormal cases and tests that prove the logic works. This library organises 20 worked PLC projects from a one-rung motor starter to batch, safety and first-fault sequences, then sends you into the browser simulator to build and break each one yourself.

Build the first example free →

Which PLC programming examples should a beginner start with?

Start with a three-wire start-stop motor circuit, then add jog control, timers, counters, interlocks and a small state sequence. That order matters. Each project introduces one new pattern while reusing the patterns before it, so you learn a transferable control vocabulary instead of memorising twenty unrelated diagrams.

The first five examples below are beginner projects. Projects six to thirteen build job-level ladder fluency. The final seven force you to handle state, faults, reset behaviour and safety boundaries. They use vendor-neutral IEC 61131-3 concepts, so the logic transfers to Siemens TIA Portal, Allen-Bradley Studio 5000, CODESYS, Mitsubishi GX Works and Omron Sysmac even where the instruction names differ.

The 20-project ladder logic progression

LevelPLC projectMain patternWhat your test must prove
1Start-stop seal-inContact, coil and holding branchStop wins when start and stop are pressed together
1Jog versus latch motorMomentary and maintained commandsJog cannot leave the motor latched
1Flashing beacon timerRepeating TON sequenceOn-time and off-time remain predictable
1On-delay motor stagingCascaded timersStage two cannot start before stage one feedback
1Bottle counting lineCTU, one-shot and resetOne bottle creates one count, not several scans
2Parking garage counterUp/down count with limitsCount never falls below zero or exceeds capacity
2Star-delta starterMutually exclusive outputsStar and delta contactors can never energise together
2Pump alternationDuty rotation and fallbackThe standby pump starts if the duty pump fails
2Water pump float switchesLevel hysteresisA chattering float cannot cycle the motor rapidly
2Tank level controlAnalogue thresholdsHigh-high level overrides normal fill control
2Conveyor start-stop and E-stopPermissives and feedbackA broken safety chain prevents a restart
2Sorting by heightEdge detection and timed rejectOne product creates one reject pulse
2Traffic-light sequenceState machineConflicting greens are unreachable
3Pedestrian crossingRequest memory and safe handoverRepeated button presses do not restart a cycle
3Sliding-gate controlDirection interlock and limitsOpen and close outputs cannot overlap
3Car-wash sequenceMulti-stage sequenceStop or fault returns every output to a defined state
3Silo fill exerciseLevel control and alarm stateSensor disagreement creates a diagnosable fault
3Batch mixer recipeRecipe, sequence and totalsAbort preserves the information needed for recovery
3Press safety interlockGuard, reset and anti-repeatReset never initiates hazardous movement
3First-fault annunciatorEvent capture and acknowledgementThe initiating fault remains identifiable after cascades

This page is the canonical owner of “PLC programming examples”, “PLC program examples”, “ladder logic examples”, “ladder diagram examples”, “PLC programming exercises” and “PLC projects for beginners”. The individual project pages own their specific machine or logic pattern. Keeping that ownership clear avoids twenty pages competing for the same broad query.

How to work through each example

Do not copy the final rung first. Use the same six-step engineering loop on every project.

  1. Rewrite the requirement as observable behaviour. “Control a motor” is vague. “The motor starts after a momentary start command, remains on after start is released, and stops when stop, overload or safety permission opens” is testable.
  2. Create the I/O list. Separate physical inputs, physical outputs, internal state bits, timers, counters and analogue values. Give tags names such as StartPB and MotorRun, not Input1 and Output3.
  3. Write the normal sequence in plain language. If you cannot explain the process without instruction names, you are not ready to program it.
  4. List abnormal cases before writing ladder. Broken stop wire, sensor stuck on, feedback missing, timer never completes, power returns during a sequence. These cases decide the structure.
  5. Build the smallest working logic. One state or rung at a time. Run after each meaningful change.
  6. Test the boundaries and record the result. A project is finished when its tests pass, not when the animation looks convincing.

That loop is the information most collections leave out. A screenshot proves that one author produced one rung. A requirement-and-test pair teaches you how to produce the next rung without the screenshot.

Example 1: start-stop motor seal-in

The process requirement is simple: a momentary start pushbutton starts a motor, the motor remains on when the button is released, and a normally closed field stop circuit stops it. Add an overload permission before treating the pattern as plant-ready.

StopHealthy  OverloadHealthy      MotorRun
----| |------------| |---------+----( )----
                               |
StartPB                        |
----| |------------------------+
                               |
MotorRun                       |
----| |------------------------+

The important test is not “does start work?” It is priority. Press start and make StopHealthy false in the same scan. The output must be false. Open the overload, restore it, and confirm the motor does not restart without a fresh start command. Those two tests distinguish a demonstration rung from a safe control pattern.

Use the contacts and coils reference if the symbols are unfamiliar, then build the complete start-stop seal-in exercise.

Example 2: timer-controlled motor staging

Suppose motor two may start five seconds after motor one is both commanded and proven running. The proof matters. Starting the timer from the command alone can bring motor two on while motor one has failed to pull in.

Motor1RunCmd  Motor1Feedback             StageDelay
----| |------------| |----------------------[TON 5s]

StageDelay.DN  Motor1Feedback                Motor2Run
----| |------------| |-------------------------( )

Test feedback loss before the timer finishes, feedback loss after motor two starts, and a rapid stop-start. Decide explicitly whether motor two must stop immediately or follow a controlled stop. The on-delay motor staging project makes you encode that decision rather than hiding it in a screenshot.

Example 3: count one product once

A photoeye can remain blocked for many PLC scans. A raw count-up instruction driven directly by the photoeye may count every scan or depend on vendor-specific counter behaviour. Create a rising-edge pulse and count the pulse.

ProductPE        ProductPulse
----|P|--------------( )

ProductPulse     BottleCount
----| |--------------[CTU 12]

Your tests should include a product that blocks the sensor for two seconds, two products with the smallest allowed gap, a stuck sensor, and reset while the sensor is blocked. Continue with the bottle counting line and the counter reference.

Example 4: star-delta mutual exclusion

The dangerous state is star and delta contactors on together. Do not rely on sequence timing alone to prevent it. Put the opposing contactor feedback or command as an interlock in each output rung, and retain the physical mechanical/electrical interlock in the real panel.

The simulator can prove the program invariant: NOT (StarCmd AND DeltaCmd). It cannot prove the physical interlock exists or is wired correctly. That division between logic proof and field proof is central to every safety-relevant example.

The star-delta starter project includes the transition delay and restart behaviour. Pair it with motor control fundamentals before attempting the press-safety example.

Example 5: sequence logic that can recover

A traffic light or car wash is usually the first useful state machine. Give every state a named bit or integer value, define one legal transition out of each state, and define what stop, abort and power restoration do.

Avoid a pile of overlapping timers whose done bits energise other timers. That structure may work on a clean animation but becomes unreadable when an operator stops halfway through a stage. The traffic-light sequence, car-wash sequence and sequencer patterns guide show the progression from timed demo to recoverable machine logic.

Open the simulator and test an example →

What makes a PLC example portfolio-worthy?

A portfolio project should contain enough evidence for another technician to understand and challenge it:

  • a one-paragraph process description;
  • an I/O list with signal type and safe state;
  • a sequence or state table;
  • the program with meaningful tag names and comments;
  • at least five normal and abnormal test cases;
  • screenshots or exported results showing those tests;
  • a short fault report explaining one bug you introduced and how you found it; and
  • a limitations note covering what the simulation does not prove.

Three polished projects beat thirty screenshots. A hiring manager can ask why you used a seal-in instead of SET/RESET, what happens after a power cycle, or how your sequence responds to missing feedback. Your evidence should let you answer by opening the project, not by reciting a definition.

For interview preparation, move from this library to PLC interview questions and live-debug preparation. For a structured learning order, use the online PLC course guide.

Common questions AI assistants and learners ask

What are the best PLC programming examples for beginners?

The best first examples are start-stop seal-in, jog control, a flashing timer, bottle counting and a traffic-light sequence. Together they teach contacts, coils, memory, timers, counters, edge detection and state—the patterns reused in larger industrial programs.

Can PLC programming examples work across Siemens and Allen-Bradley?

The control pattern transfers, but syntax and data models differ. Siemens uses LAD blocks, instance data blocks and %I/%Q or symbolic tags; Allen-Bradley uses routines, tags and instructions such as XIC, XIO and OTE. Rebuild the example in each environment rather than copying vendor syntax blindly.

Where can I practise ladder logic examples online?

Use a simulator that runs the scan, exposes live I/O and lets you test abnormal inputs. Reading the diagram develops recognition; rebuilding it from the requirement and passing tests develops programming skill. The linked browser simulator provides a free starting path.

How many PLC projects do I need before applying for a job?

There is no official number. A credible beginner portfolio normally needs three to five projects that demonstrate motor control, sequencing, analogue handling and fault-finding, each with clear tests. Quality, explanation and failure handling matter more than project count.

Are these examples safe to download to a real machine?

No example should be downloaded unchanged. Real machinery requires a risk assessment, verified electrical design, hardware safety functions, site standards, peer review and commissioning tests. Simulation validates control logic; it does not certify a machine as safe.

Standards and boundaries

The examples use the programming-language concepts standardised in IEC 61131-3. Vendor implementations add their own instructions, timing details, task models and safety systems, so check the manual for the target controller before porting a project.

These projects are educational logic exercises. They do not replace lock-out procedures, supervised panel work, machine risk assessment or a safety PLC design review. The simulator is the place to make cheap mistakes before hardware; it is not evidence that field wiring or machinery is safe.

Start with the free ladder logic project →

Supporting field notes

Technical visual library

6 original diagrams in this guide
System map for plc programming examples, showing field inputs, control logic, outputs and feedback
System map: follow the signal from the field through control logic and back to the process.
Learning roadmap for plc programming examples, from foundations to safe practical assessment
Learning roadmap: build the foundation before moving into practical fault finding and assessment.
Skills matrix for plc programming examples, covering theory, software, hardware and industrial safety
Skills matrix: a credible course balances theory, software, hardware practice and safety.
Equipment layers for plc programming examples, from sensors and controllers to plant supervision
Equipment layers: understand how field devices, controllers, networks and supervision fit together.
Decision checklist for choosing plc programming examples by career goal, format and practical evidence
Decision checklist: compare the outcome, delivery format and practical evidence before paying.

By PLC Programming SA · Last updated 2026-07-30