Product: | Elvis |
Version: | 2.5 |
Booth: | 2006-12-13 |
Summary
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.
Details
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:
CODE:vb:Sub NameDesKontrollelements_Click()
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
alarm. Datapoint.AcknowledgeAlarm(“”)
End If
alarm. Next
Loop
End Sub//CODE
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:
CODE:vb:Sub NameDesKontrollelements_Click()
Application.PlaySound(“”)
End Sub //CODE