Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start the batch process when the start button is pressed.
PLC Programming
IF StartButton = [1] THEN
BatchProcess := TRUE;
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Using FALSE instead of TRUE to check the button state.
Using numeric values instead of boolean TRUE.
✗ Incorrect
The batch process should start when the StartButton is TRUE (pressed).
2fill in blank
mediumComplete the code to stop the batch process when the stop button is pressed.
PLC Programming
IF StopButton = [1] THEN
BatchProcess := FALSE;
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Using FALSE instead of TRUE to check the button state.
Using numeric values instead of boolean TRUE.
✗ Incorrect
The batch process stops when the StopButton is TRUE (pressed).
3fill in blank
hardFix the error in the code to correctly check if the batch process is running.
PLC Programming
IF BatchProcess = [1] THEN
IndicatorLight := TRUE;
ELSE
IndicatorLight := FALSE;
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Comparing boolean to numeric or string values.
Using undefined constants like START.
✗ Incorrect
BatchProcess is a boolean variable, so it should be compared to TRUE.
4fill in blank
hardFill both blanks to set the batch process to running and turn on the indicator light.
PLC Programming
BatchProcess := [1]; IndicatorLight := [2];
Attempts:
3 left
💡 Hint
Common Mistakes
Setting one or both variables to FALSE by mistake.
Confusing TRUE and FALSE values.
✗ Incorrect
Both BatchProcess and IndicatorLight should be set to TRUE to indicate running.
5fill in blank
hardFill all three blanks to create a timer that runs for 10 seconds when the batch process starts.
PLC Programming
IF BatchProcess = [1] THEN Timer.IN := [2]; Timer.PT := T#[3]S; END_IF;
Attempts:
3 left
💡 Hint
Common Mistakes
Setting Timer.IN to FALSE or BatchProcess to FALSE.
Using wrong time format or value for Timer.PT.
✗ Incorrect
The timer input (IN) is set to TRUE when BatchProcess is TRUE, and the preset time (PT) is 10 seconds.
