The following options are available in Elvis to acknowledge an alarm:
- via the built-in alarm list (double-click and acknowledge click)
- via the AlarmListControl (same functionality)
- implicitly about the successful dispatch of a report (if the check mark is set in the Receipt column)
This article describes how to alternatively acknowledge all alarms via a StateButton placed on a control page.
Sometimes you just want to turn off the alarm sound configured via Extras/Options/Alarm; This is also described.
First, place a StateButton on the page. It is sufficient if it has a state. The desired image or text is then assigned to the states “-” (unknown) and “0”.
Then you add with “Events..” (context menu) enter the code to be executed when clicked.
To acknowledge all pending alarms, the code should look like this:
Dim alarm As Object
Set alarm = Database.AlarmHistory
Do While alarm. EventType <> 0 And alarm. Time >= CDate(CDbl(Now)-1)
If alarm. Datapoint.AlarmState = Asc(“A”) Then
Explanation: With Database.AlarmHistory you get the most recent alarm event; With alarm. Next, you then continue the alarm history towards the past. The termination criteria of the while loop are EventType (no further alarm event) and Time (event older than 1 day).
If you just want to turn off the alarm sound, it’s easy to do it with:
End Sub //CODE