Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to acknowledge an alarm when the button is pressed.
PLC Programming
IF Button_Pressed THEN Alarm_[1] := TRUE; END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Reset' instead of 'Acknowledge' clears the alarm instead of confirming it.
Using 'Trigger' or 'Clear' does not match the action of acknowledging.
✗ Incorrect
The 'Acknowledge' flag is set to TRUE to confirm the alarm has been noticed.
2fill in blank
mediumComplete the code to display the alarm message on the HMI screen.
PLC Programming
IF Alarm_Active THEN HMI_Display := [1]; END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Alarm_Code' shows a number, not a message.
Using 'Alarm_Status' or 'Alarm_Time' does not display the message.
✗ Incorrect
The 'Alarm_Message' contains the text to show on the HMI when the alarm is active.
3fill in blank
hardFix the error in the alarm reset logic.
PLC Programming
IF Reset_Button AND Alarm_[1] THEN Alarm_Active := FALSE; END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Checking 'Acknowledge' instead of 'Active' causes reset to fail.
Using 'Reset' or 'Triggered' is incorrect for this condition.
✗ Incorrect
The condition should check if the alarm is active before resetting it.
4fill in blank
hardFill both blanks to filter and display only active alarms with high priority.
PLC Programming
FOR i := 1 TO Alarm_Count DO IF Alarms[i].[1] AND Alarms[i].Priority [2] 5 THEN Display_Alarm(Alarms[i]); END_IF; END_FOR;
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Acknowledged' instead of 'Active' shows alarms already handled.
Using '<=' instead of '>' shows low priority alarms.
✗ Incorrect
We check if the alarm is active and if its priority is greater than 5 to display it.
5fill in blank
hardFill all three blanks to create a dictionary of alarm messages for active alarms only.
PLC Programming
Alarm_Dict := {Alarms[[1]].ID: Alarms[[2]].[3] FOR [1] IN 1..Alarm_Count IF Alarms[[2]].Active};Attempts:
3 left
💡 Hint
Common Mistakes
Using different variables for keys and values causes errors.
Using 'Status' instead of 'Message' stores wrong data.
✗ Incorrect
We use the same index 'i' to get the alarm ID and message for active alarms only.
