Alarm functions¶
webMI.alarm.accept
- webMI.alarm.accept(ids)¶
Accepts the alarm conditions defined by the array ids. Each id can be an alarm condition (conditionID) or an AlarmId.
- webMI.alarm.acceptDisplay()¶
Accepts all unaccepted alarms that are subscribed on the current display (via
webMI.alarm.subscribe()).
- webMI.alarm.subscribe(conditionID, function(e){...})¶
Subscribes to the alarm specified by conditionID. Every time the alarm state of this condition changes, the callback function is executed and an alarm object is passed in as parameter e.
Returns a subscriptionId, which can be used to unsubscribe the alarm state changes.
Example:
webMI.alarm.subscribe("AGENT.OBJECTS.bAlarmNode.AlarmConfiguration.Condition1", function(e) { var value = e.state; if (value == 0) alert("State of alarm changed to Off, Acknowledged!"); if (value == 1) alert("State of alarm changed to On, Unacknowledged!"); if (value == 2) alert("State of alarm changed to On, Acknowledged!"); if (value == 3) alert("State of alarm changed to Off, Unacknowledged!"); if (value == 5) alert("State of alarm changed to On Off, Unacknowledged!"); });
- webMI.alarm.unsubscribe(subscriptionId)¶
Unsubscribes the alarm condition with the given subscriptionId (return value from
webMI.alarm.subscribe()). The previously created subscription will not receive a notification of the callback function anymore.