Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start the off-delay timer when the input turns off.
PLC Programming
if input_signal == False: timer_start = [1]
Attempts:
3 left
💡 Hint
Common Mistakes
Setting timer_start to False stops the timer instead of starting it.
Using None or 0 does not correctly start the timer.
✗ Incorrect
The off-delay timer starts timing when the input signal turns off, so setting timer_start to True activates the timer.
2fill in blank
mediumComplete the code to reset the off-delay timer when the input is on.
PLC Programming
if input_signal == True: timer_reset = [1]
Attempts:
3 left
💡 Hint
Common Mistakes
Setting timer_reset to True keeps the timer running.
Using None or 1 does not properly reset the timer.
✗ Incorrect
When the input signal is on, the off-delay timer should reset, so timer_reset must be set to False.
3fill in blank
hardFix the error in the timer countdown logic.
PLC Programming
if timer_running: timer_value [1] 1
Attempts:
3 left
💡 Hint
Common Mistakes
Using += increases the timer value instead of decreasing it.
Using *= or /= changes the timer value incorrectly.
✗ Incorrect
The timer counts down by subtracting 1 from the timer value each cycle when running.
4fill in blank
hardFill both blanks to check if the timer has expired and reset it.
PLC Programming
if timer_value [1] 0: timer_running = [2]
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' misses cases where timer_value is negative.
Setting timer_running to True keeps the timer running after expiry.
✗ Incorrect
The timer expires when its value is less than or equal to zero, and then the timer_running flag should be set to False to stop it.
5fill in blank
hardFill all three blanks to implement the off-delay timer output logic.
PLC Programming
if input_signal == True: output_signal = [1] elif timer_running == True and timer_value [2] 0: output_signal = [3]
Attempts:
3 left
💡 Hint
Common Mistakes
Setting output to False when timer is still running.
Using incorrect comparison operators for timer_value.
✗ Incorrect
When input is on, output is True. When timer is running and timer_value is greater than zero, output remains True.
