Bird
Raised Fist0
PLC Programmingscripting~10 mins

Simple conveyor belt control in PLC Programming - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Simple conveyor belt control
Start
↓
Check Start Button
Yes|No↓
Stop Conveyor
↓
Turn Conveyor ON
↓
Check Stop Button
Yes|No↓
Turn Conveyor OFF
↓
End
The conveyor starts when the start button is pressed and stops when the stop button is pressed.
Execution Sample
PLC Programming
IF StartButton THEN
  Conveyor := TRUE;
ELSIF StopButton THEN
  Conveyor := FALSE;
END_IF;
This PLC code turns the conveyor on when the start button is pressed and off when the stop button is pressed.
Execution Table
StepStartButtonStopButtonCondition EvaluatedConveyor StateAction Taken
1FALSEFALSEStartButton = FALSEOFFNo action, conveyor remains OFF
2TRUEFALSEStartButton = TRUEONConveyor turned ON
3TRUEFALSEStartButton = TRUEONConveyor remains ON
4FALSEFALSEStartButton = FALSEONNo stop pressed, conveyor remains ON
5FALSETRUEStopButton = TRUEOFFConveyor turned OFF
6FALSEFALSEStartButton = FALSEOFFNo action, conveyor remains OFF
💡 Execution stops after checking inputs; conveyor state updated accordingly.
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4After Step 5After Step 6
StartButtonFALSEFALSETRUETRUEFALSEFALSEFALSE
StopButtonFALSEFALSEFALSEFALSEFALSETRUEFALSE
ConveyorOFFOFFONONONOFFOFF
Key Moments - 2 Insights
Why does the conveyor stay ON even when StartButton is FALSE at step 4?
Because the StopButton is also FALSE, so the conveyor does not receive a command to turn OFF. The code only turns OFF the conveyor when StopButton is TRUE (see step 4 in execution_table).
What happens if both StartButton and StopButton are TRUE at the same time?
The code checks StartButton first and turns the conveyor ON. The StopButton condition is checked only if StartButton is FALSE, so StopButton TRUE will not turn it OFF in this case.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the Conveyor state at step 3?
AOFF
BON
CUndefined
DFlashing
💡 Hint
Check the 'Conveyor State' column at step 3 in the execution_table.
At which step does the conveyor turn OFF after being ON?
AStep 2
BStep 4
CStep 5
DStep 6
💡 Hint
Look for the step where 'Conveyor State' changes from ON to OFF in the execution_table.
If StopButton is TRUE at step 2, what would happen to the conveyor?
AConveyor turns ON
BConveyor turns OFF
CNo change, stays OFF
DConveyor flashes
💡 Hint
Remember the code checks StartButton first; if StartButton is TRUE, conveyor turns ON regardless of StopButton.
Concept Snapshot
Simple conveyor control:
- If StartButton pressed, conveyor ON
- Else if StopButton pressed, conveyor OFF
- Else conveyor state unchanged
Use IF-ELSIF-END_IF structure
Checks inputs each cycle to update conveyor
Full Transcript
This simple conveyor belt control program uses two inputs: StartButton and StopButton. When the StartButton is pressed (TRUE), the conveyor turns ON. If the StartButton is not pressed but the StopButton is pressed, the conveyor turns OFF. If neither button is pressed, the conveyor keeps its current state. The program checks these conditions in order every cycle to control the conveyor motor. This ensures the conveyor only runs when started and stops when commanded.

Practice

(1/5)
1. What is the main purpose of a simple conveyor belt control program in PLC programming?
easy
A. To measure the speed of the conveyor belt
B. To change the direction of the conveyor belt automatically
C. To count the number of items on the conveyor
D. To start and stop the conveyor motor using buttons

Solution

  1. Step 1: Understand the basic function of the program

    The simple conveyor belt control program uses start and stop buttons to control the motor.
  2. Step 2: Identify the main control action

    The program's main action is to start or stop the conveyor motor based on button presses.
  3. Final Answer:

    To start and stop the conveyor motor using buttons -> Option D
  4. Quick Check:

    Conveyor control = start/stop motor [OK]
Hint: Focus on start/stop buttons controlling motor [OK]
Common Mistakes:
  • Confusing control with measuring speed
  • Thinking it counts items automatically
  • Assuming automatic direction change
2. Which of the following is the correct syntax to check if the start button is pressed in a PLC program?
easy
A. WHILE StartButton == TRUE DO Motor = ON;
B. IF Motor = ON THEN StartButton := TRUE;
C. IF StartButton = TRUE THEN Motor := ON;
D. FOR StartButton = TRUE TO Motor = ON;

Solution

  1. Step 1: Identify correct IF statement syntax in PLC

    PLC uses IF condition THEN action; format to check inputs and set outputs.
  2. Step 2: Match syntax to check start button and turn motor ON

    IF StartButton = TRUE THEN Motor := ON; correctly checks if StartButton is TRUE and sets Motor ON.
  3. Final Answer:

    IF StartButton = TRUE THEN Motor := ON; -> Option C
  4. Quick Check:

    IF condition THEN action; = IF StartButton = TRUE THEN Motor := ON; [OK]
Hint: Look for IF condition THEN action syntax [OK]
Common Mistakes:
  • Using assignment instead of comparison
  • Using WHILE or FOR loops incorrectly
  • Reversing input and output roles
3. Given this PLC code snippet:
IF StartButton = TRUE THEN
  Motor := ON;
ELSE IF StopButton = TRUE THEN
  Motor := OFF;
END_IF;

What is the state of Motor if StartButton is FALSE and StopButton is TRUE?
medium
A. Motor is ON
B. Motor is OFF
C. Motor state does not change
D. Motor causes an error

Solution

  1. Step 1: Check StartButton condition

    StartButton is FALSE, so first IF condition fails, move to ELSE IF.
  2. Step 2: Check StopButton condition

    StopButton is TRUE, so Motor is set to OFF.
  3. Final Answer:

    Motor is OFF -> Option B
  4. Quick Check:

    StopButton TRUE turns Motor OFF [OK]
Hint: Follow IF-ELSE logic step-by-step [OK]
Common Mistakes:
  • Assuming Motor stays ON when StartButton is FALSE
  • Ignoring ELSE IF condition
  • Thinking Motor state causes error
4. Identify the error in this PLC code snippet for conveyor control:
IF StartButton = TRUE THEN
  Motor = ON;
ELSE
  Motor = OFF;
END_IF;
medium
A. Using '=' instead of ':=' for assignment
B. Missing END_IF statement
C. Incorrect IF syntax, should use 'WHEN'
D. Motor variable not declared

Solution

  1. Step 1: Check assignment operator in PLC

    PLC uses ':=' for assignment, '=' is for comparison.
  2. Step 2: Identify incorrect operator usage

    Code uses '=' to assign Motor ON/OFF, which is incorrect syntax.
  3. Final Answer:

    Using '=' instead of ':=' for assignment -> Option A
  4. Quick Check:

    Assignment needs ':=' not '=' [OK]
Hint: Remember ':=' is assignment in PLC code [OK]
Common Mistakes:
  • Confusing '=' with ':='
  • Forgetting END_IF (though present here)
  • Thinking IF syntax uses 'WHEN'
5. You want the conveyor motor to start only if the StartButton is pressed and the EmergencyStop is NOT pressed. Which PLC code snippet correctly implements this logic?
hard
A. IF StartButton = TRUE AND EmergencyStop = FALSE THEN Motor := ON; ELSE Motor := OFF; END_IF;
B. IF StartButton = TRUE OR EmergencyStop = FALSE THEN Motor := ON; ELSE Motor := OFF; END_IF;
C. IF StartButton = TRUE THEN Motor := ON; ELSE IF EmergencyStop = FALSE THEN Motor := OFF; END_IF;
D. IF NOT StartButton = TRUE AND EmergencyStop = FALSE THEN Motor := ON; ELSE Motor := OFF; END_IF;

Solution

  1. Step 1: Understand the required condition

    Motor starts only if StartButton is TRUE and EmergencyStop is FALSE (not pressed).
  2. Step 2: Check logical operators in options

    IF StartButton = TRUE AND EmergencyStop = FALSE THEN Motor := ON; ELSE Motor := OFF; END_IF; uses AND to require both conditions correctly.
  3. Final Answer:

    IF StartButton = TRUE AND EmergencyStop = FALSE THEN Motor := ON; ELSE Motor := OFF; END_IF; -> Option A
  4. Quick Check:

    AND logic matches start and no emergency [OK]
Hint: Use AND for both conditions true [OK]
Common Mistakes:
  • Using OR instead of AND
  • Misplacing NOT operator
  • Separating conditions incorrectly
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard