PLC Exercises

Practice PLC programming with hands-on exercises spanning digital logic, motor control, timers, math, and sequencing.

1Pick an exercise
Browse the exercises below and choose one that matches your skill level.
2Read the spec
Each exercise describes the inputs, outputs, and expected behavior your solution must satisfy.
3Solve in Rungs Studio
Open the exercise in Studio, write your solution, then click Test in the toolbar to verify your work.
NOT Gate
Implement a logical NOT gate Add-On Instruction in rungs.dev that inverts a single BOOL input every scan and writes the negated result to the output.
beginner
AND Gate
Implement a logical AND gate Add-On Instruction in rungs.dev that outputs 1 only when both BOOL inputs are 1, and 0 otherwise — evaluated every scan.
beginner
LED Control
Control an LED output in rungs.dev based on the logical combination of two push-button BOOL inputs — set the LED on when In_Pb1 is 1 and In_Pb2 is 0.
beginner
Find Max Value
Find and output the larger of two DINT inputs every scan in this rungs.dev AOI. Handles equal values, negative values, and the full DINT range correctly.
beginner
Constant Pass-Through
Pass an integer input straight through to one DINT output every scan, while a second DINT output holds the constant value 43 — a starter rungs.dev AOI.
beginner
Pressure Comparator
Monitor a REAL pressure value against a static threshold in rungs.dev. The AOI sets a critical-state output when pressure drops below the threshold.
beginner
Toggle Output
Toggle a BOOL output on the rising edge of a button input. The rungs.dev Add-On Instruction detects edges every scan, including the very first one.
beginner
Loop Counter
Increment a dual-stage counter (MicroCount + MacroCount) every scan while enabled in rungs.dev, and report the combined total as a single DINT output.
beginner
Greenhouse Watering System
Control greenhouse sprinklers in rungs.dev based on soil moisture with hysteresis: turn on below 30%, off at or above 70%, hold inside the deadband.
beginner
Nested Loop Control
Run a nested FOR loop every scan in this rungs.dev Add-On Instruction and report the total inner-loop iteration count — 1001 when fully enabled.
intermediate
Coffee Machine Control
Control a coffee machine in rungs.dev with a 5-state machine: Idle, Heating, Grinding, Brewing, Ready — driven by start, reset, and step-done inputs.
intermediate
Sandwich Maker
Run a sandwich-assembly sequence in rungs.dev driven by bread and ingredient sensors — count slices on rising edges and start the conveyor and assemble motors.
intermediate

Frequently Asked Questions