Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start the conveyor motor when the start button is pressed.
PLC Programming
IF StartButton = TRUE THEN
ConveyorMotor := [1];
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Setting the motor to OFF instead of ON.
Using RESET or STOP which do not start the motor.
✗ Incorrect
The conveyor motor should be turned ON when the start button is pressed.
2fill in blank
mediumComplete the code to increment the parts counter when the sensor detects a part.
PLC Programming
IF Sensor = TRUE THEN
PartsCounter := PartsCounter [1] 1;
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Using '-' which decreases the counter.
Using '*' or '/' which are not for incrementing.
✗ Incorrect
The parts counter should increase by 1 when a part is detected, so use the '+' operator.
3fill in blank
hardFix the error in the code to reset the parts counter when the reset button is pressed.
PLC Programming
IF ResetButton = TRUE THEN
PartsCounter := [1];
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Assigning PartsCounter to itself does not reset it.
Using 1 or NULL which do not reset the counter properly.
✗ Incorrect
To reset the counter, set PartsCounter to 0.
4fill in blank
hardFill both blanks to stop the conveyor motor when the stop button is pressed and reset the parts counter.
PLC Programming
IF StopButton = TRUE THEN
ConveyorMotor := [1];
PartsCounter := [2];
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Turning motor ON instead of OFF.
Resetting counter to 1 instead of 0.
✗ Incorrect
When stopping, the motor should be OFF and the parts counter reset to 0.
5fill in blank
hardFill all three blanks to create a condition that starts the conveyor only if the start button is pressed, the stop button is not pressed, and the parts counter is less than 100.
PLC Programming
IF StartButton = TRUE AND StopButton = FALSE AND PartsCounter [1] [2] THEN ConveyorMotor := [3]; END_IF;
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' instead of '<' for the counter check.
Turning motor OFF instead of ON.
✗ Incorrect
The conveyor starts if PartsCounter is less than 100, so use '<' and 100, and turn motor ON.
