Ladder Logic Program for Conveyor Belt Control in PLC
Start and Stop push buttons to control a Motor output coil with a seal-in (holding) contact; for example, Start --| |----+----( Motor ) and Stop --|/|----| with a holding contact from Motor coil in parallel to Start button.Examples
How to Think About It
Algorithm
Code
(* Ladder Logic for Conveyor Belt Control *) (* Inputs: Start PB = I0.0, Stop PB = I0.1 *) (* Output: Motor = Q0.0 *) (* Network 1: Motor control with seal-in *) (* |---[Stop]---+---[Start]---+---(Motor)---| *) (* | | | | *) (* | +---[Motor]---+ | *) (* Ladder logic *) (* Stop button is normally closed contact *) (* Start button is normally open contact *) (* Motor coil contact is normally open contact *) (* Rung *) (* Motor := NOT Stop AND (Start OR Motor) *) (* In structured text for clarity: *) (* Motor := NOT I0.1 AND (I0.0 OR Motor); *) (* In ladder logic symbols: *) (* --|/|--| |--+--| |--( ) *) (* Stop Start Motor Motor *) (* This logic energizes Motor when Start is pressed and keeps it on until Stop is pressed. *)
Dry Run
Let's trace pressing Start then Stop through the ladder logic.
Initial state
Stop = not pressed (true), Start = not pressed (false), Motor = off (false)
Press Start button
Start = pressed (true), Stop = true, Motor = false
Evaluate Motor coil
Motor = NOT Stop AND (Start OR Motor) = true AND (true OR false) = true, Motor energizes
Release Start button
Start = false, Stop = true, Motor = true (holding contact keeps Motor energized)
Press Stop button
Stop = pressed (false), Motor = true
Evaluate Motor coil
Motor = NOT Stop AND (Start OR Motor) = false AND (false OR true) = false, Motor de-energizes
| Step | Stop | Start | Motor |
|---|---|---|---|
| 1 | true | false | false |
| 2 | true | true | false |
| 3 | true | true | true |
| 4 | true | false | true |
| 5 | false | false | true |
| 6 | false | false | false |
Why This Works
Step 1: Stop button normally closed
The Stop button is a normally closed contact, so when not pressed it allows current to flow.
Step 2: Start button energizes motor
Pressing the Start button closes its contact, energizing the motor coil.
Step 3: Holding contact keeps motor running
A contact from the motor coil in parallel with the Start button keeps the motor energized after releasing Start.
Step 4: Stop button breaks circuit
Pressing the Stop button opens its contact, breaking the circuit and de-energizing the motor coil.
Alternative Approaches
(* Add TON timer to delay motor stop after Stop pressed *)
(* Motor runs while timer not done *)
(* Start and Stop logic same, but motor output controlled by timer done bit *)(* Use latch (SET) and unlatch (RESET) instructions for motor control *)
(* SET motor on Start press, RESET motor on Stop press *)Complexity: O(1) time, O(1) space
Time Complexity
The ladder logic runs in constant time each scan cycle, checking inputs and updating outputs without loops.
Space Complexity
Uses fixed memory for inputs, outputs, and internal coil states; no dynamic memory allocation.
Which Approach is Fastest?
All approaches run in constant time; using latch instructions may simplify logic but does not affect speed significantly.
| Approach | Time | Space | Best For |
|---|---|---|---|
| Basic Start/Stop with holding contact | O(1) | O(1) | Simple, reliable conveyor control |
| Timer delay on stop | O(1) | O(1) | Smooth motor stop with delay |
| Latch coil instructions | O(1) | O(1) | Simplified logic if PLC supports latches |