Overview
This article explains the NA HMI alarms system behaviour in runtime.
For basic information about how to configure and set up alarms in NA please read ‘Introduction to NA Alarms’ article.
Runtime Behaviour
The runtime engine includes an Alarm Handler process that continuously monitors the User Alarms that are configured for the project. The Alarm Handler detects state changes in User Alarms and responds to the state changes by producing Operator notifications and by creating data entries into a User Alarm Log.
Each time a User Alarm is raised, acknowledged or cleared is captured in runtime by the Alarm Handler. On each event the Alarm Handler creates a data entry into the User Alarm Log. The sum of the data entries in the User Alarm Log constitutes the User Alarm History. All logging occurs in MRAM and is stored as a circular buffer with at least 2048 log entries and will not be cleared during a power cycle. When the maximum size is exceeded then the oldest log entry will be overwritten by new data. System Variables can be used to monitor the number of alarms in the system, and methods are provided to save the alarm log (see below).
Alarm Statuses
Each User Alarm can exist in one of five states:
- Acquiescent
- Raised – Requiring acknowledgement, but not acknowledged
- Raised – Acknowledged or not requiring acknowledgement
- Cleared – Requiring acknowledgement, but not acknowledged
- Cleared - Acknowledged or not requiring acknowledgement
Acquiescent - The User Alarm has never been raised in the current runtime session
Raised – Raised state for a User Alarm is achieved when the expression associated with the User Alarm resolves to True
Cleared – Cleared state for a User Alarm is achieved when the expression associated with the User Alarm resolves to False (having previously been True)
Acknowledged / Not Acknowledged – Acknowledgement is a process applied by the runtime user confirming their recognition that a User Alarm has been raised. Whether User Acknowledgement is required or not can optionally be applied for each individual User Alarm.
Alarms in VB
The following functions are available for the user to use within VB:
AcknowledgeUserAlarm |
1. AlarmID |
1. Alarm |
Acknowledges the specified user alarm. |
AcknowledgeLatestUserAlarm |
<None> |
<None> |
Acknowledges the latest user alarm. |
AcknowledgeAllUserAlarms |
<None> |
<None> |
Acknowledge all user alarms. |
IsUserAlarmActive |
1. AlarmID |
1. Alarm |
Returns TRUE if the specified alarm is active, otherwise F ALSE will be return. Active states are Raised & Acknowledged, Raised & Unacknowledged and Cleared & Unacknowledged. |
IsUserAlarmRaised |
1. AlarmID |
1. Alarm |
Returns TRUE if the specified alarm is raised or FALSE if it is cleared. |
ClearUserAlarmLog |
<None> |
<None> |
Removes all current alarm data stored in MRAM (the data will be lost and is unrecoverable). |
SaveUserAlarmLogToFile |
1. File Name |
1. String |
Copies the current user alarm data from MRAM and saves it into the specified file. |
ReadActiveUserAlarmInfo |
1. Active Alarm Number |
1. Integer |
Gets the alarm information (alarm name, group name, level, message and details) associated with the specified Active Alarm Number. The Active Alarm Number is simply the order of the alarms in the viewer (i.e. the order in which they were raised). |
ScrollAlarmViewerList |
1. Page Name |
1. String |
Scrolls the specified alarm viewer object up or down by the amount defined in the 'Scroll Amount' parameter. When the value 1 is passed to the 'Direction' parameter then alarm viewer object will be scrolled upwards (to scroll downwards, the value 2 must be passed). The 'Scroll Amount' parameter defines how many will be scrolled each time the function is called. |
GetSelectedAlarm |
1. Page Name 2. Alarm Viewer Object Name Returns: AlarmID |
1. String 2. String Return Type: String |
Gets the selected alarm ID from the specified viewer. |
GetAlarmInfo |
1. AlarmID 2. Name 3. Group 4. Alarm Code 5. Level 6. Message 7. Details |
1. String 2. String (ByRef) 3. String (ByRef) 4. String (ByRef) 5. String (ByRef) 6. String (ByRef) 7. String (ByRef) |
Returns the Alarm information for the specified Alarm ID. |
Note: the AlarmViewer also has a property called ‘SelectedAlarm’ (ID) which enables VB to find the currently selected alarm for some of the functions above.
Note: For the list of Alarm’s system variables please read ‘Introduction to NA System Variables’ article