Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start the timer when the input is ON.
PLC Programming
IF input_signal = [1] THEN
start_timer()
END_IFAttempts:
3 left
💡 Hint
Common Mistakes
Using FALSE instead of TRUE to start the timer.
Using numeric values like 0 or 1 instead of TRUE.
✗ Incorrect
The timer starts when the input signal is TRUE (ON).
2fill in blank
mediumComplete the code to reset the timer when the reset button is pressed.
PLC Programming
IF reset_button = [1] THEN
reset_timer()
END_IFAttempts:
3 left
💡 Hint
Common Mistakes
Using FALSE instead of TRUE for reset condition.
Confusing numeric values with boolean.
✗ Incorrect
The timer resets when the reset button is pressed (TRUE).
3fill in blank
hardFix the error in the timer comparison to check if the timer has finished.
PLC Programming
IF timer_elapsed_time [1] preset_time THEN
light := TRUE
END_IFAttempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>=' causes light to turn on too early.
Using '==' may miss the exact match if time skips.
✗ Incorrect
The light turns ON when the timer elapsed time is greater than or equal to the preset time.
4fill in blank
hardComplete the code to toggle the light state after the timer finishes.
PLC Programming
IF timer_done = [1] THEN
light := NOT light;
END_IFAttempts:
3 left
💡 Hint
Common Mistakes
Using FALSE for timer_done condition.
Missing semicolon causes syntax error.
✗ Incorrect
The light toggles when the timer is done (TRUE). The semicolon ends the statement.
5fill in blank
hardComplete the code to create a flashing light loop with timer reset and start.
PLC Programming
IF light = [1] THEN
reset_timer();
start_timer();
END_IFAttempts:
3 left
💡 Hint
Common Mistakes
Checking if light is TRUE instead of FALSE.
Missing semicolons after commands.
Using newline instead of semicolon to end statements.
✗ Incorrect
When light is FALSE (OFF), reset and start the timer. Each statement ends with a semicolon.
