PLC programming exercises with a worked example
Conveyor permission
A fictional labeling conveyor may run only when its start request and guard permission are both true. Treat the guard permission as an input supplied to this exercise. The example teaches Boolean logic; it doesn’t model a safety-rated guard circuit.
| Start request | Permission | Run command |
|---|---|---|
| False | False | False |
| False | True | False |
| True | False | False |
| True | True | True |
Put the two conditions in series before the run coil. Test all four rows. If the conveyor runs with only one condition true, you have built an OR condition, often by putting the contacts in parallel.
Fault condition
Add a fault input. A true fault must prevent the run command for either start state. Test the fault while the conveyor is already running as well as before it starts. Testing only startup misses the case where a permission disappears during operation.
Transfer task
For a second fictional machine, either of two start stations may request a run, but both share the same permission. Group the start requests in parallel and put the permission in series with the entire group. If one start branch bypasses the permission, one station can run the machine when permission is false.
Use the player to test your own answer, then compare the worked solution. Continue with the ladder logic reference and timer exercises. The full PLC course adds counters, latches and fault-finding projects.