Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set the timer preset value to 5000 milliseconds.
PLC Programming
Timer1.PRE = [1]Attempts:
3 left
💡 Hint
Common Mistakes
Using the accumulated value (ACC) instead of a fixed number.
Setting the preset to zero, which means no delay.
✗ Incorrect
The preset value (PRE) sets the timer duration in milliseconds. Here, 5000 means 5 seconds.
2fill in blank
mediumComplete the code to reset the timer accumulated value to zero.
PLC Programming
Timer2.ACC = [1]Attempts:
3 left
💡 Hint
Common Mistakes
Setting ACC to the preset value instead of zero.
Using the enable bit (EN) instead of a number.
✗ Incorrect
Resetting the accumulated value (ACC) to zero clears the timer count.
3fill in blank
hardFix the error in the code to correctly compare the accumulated value with the preset.
PLC Programming
IF Timer3.ACC [1] Timer3.PRE THEN
// Timer done
END_IFAttempts:
3 left
💡 Hint
Common Mistakes
Using '=' which only checks exact equality.
Using '<' which checks if ACC is less than PRE.
✗ Incorrect
The timer is done when the accumulated value is greater than or equal to the preset.
4fill in blank
hardFill both blanks to create a dictionary of timers with their preset and accumulated values.
PLC Programming
timers = {"T1": [1], "T2": [2]Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up preset and accumulated values.
Using the same value for both timers.
✗ Incorrect
The dictionary maps timer names to their preset and accumulated values respectively.
5fill in blank
hardFill all three blanks to create a conditional that resets the timer if accumulated value exceeds preset.
PLC Programming
IF Timer4.ACC [1] Timer4.PRE THEN Timer4.ACC = [2] Timer4.EN = [3] END_IF
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' in the condition.
Setting EN to True instead of False when resetting.
✗ Incorrect
If accumulated value is greater than preset, reset ACC to zero and disable the timer.
