Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Scripting_function


Panel
titleDescription

Acknowledges any number of alarms, specified by their event ids. The event id is generated for an alarm when it becomes active, and it is used to identify a particular event from other events for the same source. The alarms will be acknowledged by the logged in user making the call. Additionally, acknowledgement notes may be included and will be stored along with the acknowledgement.

This function uses different parameters based on the scope of the script calling it. Both versions are listed below.

Panel
titleClient Permission Restrictions

Permission Type: Alarm Management

Client access to this scripting function is blocked to users that do not meet the role/zone requirements for the above permission type. This function is unaffected when run in the Gateway scope.

Panel
titleSyntax - Client Scripts

system.alarm.acknowledge(alarmIds, notes)

  • Parameters

List[String] alarmIds  - List of alarm event ids (UUIDs) to acknowledge.

String  notes  - A string that will be used as the Ack Note on each acknowledged alarm event. If set to None , then an Ack Note note will not be assigned to the alarm event. 

  • Returns

Nothing

editor_notes

               Nothing

Changed_in
Version8.1.15


As of 8.1.15, the function now returns the following:

List[String] almIds  - List of alarm event ids (UUIDs) that were unable to be acknowledged successfully.

  • Scope

Vision Client

Panel
titleSyntax - Gateway Scripts

system.alarm.acknowledge(alarmIds, notes, username)

  • Parameters

List[String] alarmIds  - List of alarm event ids (UUIDs) to acknowledge.

String  notes  -  A A string that will be used as the Ack Note on each acknowledged alarm event. If  If set to None , then an Ack Note note will not be assigned to the alarm event. 

String  username - The user that acknowledged the alarm. 

  • Returns

               Nothing

Notechanged_friendly

This parameter is only used when called from a Gateway-scoped script. This parameter should be omitted from any Client-based scripts.

  • Returns
Nothing
in
Version8.1.15


As of 8.1.15, the function now returns the following:

List[String] almIds  - List of alarm event ids (UUIDs) that were unable to be acknowledged successfully.

  • Scope

Gateway, Perspective Session

Panel
titleExamples
Code Block
languagepy
titleCode Snippet - Acknowledging an Alarm in Client Scope
# This example shows the basic syntax for acknowledging an alarm from a Client-based script
system.alarm.acknowledge(['c27c06d8-698f-4814-af89-3c22944f58c5'],'Saw this alarm, did something about it.')
Panel
Code Block
languagepy
titleCode Snippet - Acknowledging an Alarm in Gateway Scope
# This example shows the basic syntax for acknowledging an alarm from a Gateway-based script
system.alarm.acknowledge(['c27c06d8-698f-4814-af89-3c22944f58c5'],'Saw this alarm, did something about it.', 'admin')
Panel
Code Block
languagepy
titleCode Snippet - Acknowledging Selected Alarms from a Table
# This code snippet could be used as a mouseReleased event handler on a Table component (not an Alarm Status Table component) 
# whose data was the return value of the system.alarm.queryStatus  function.
# It presents a right-click menu to acknowledge the currently selected alarms (for more than one, the table must be set to allow multiple selection). 
# This example does not ask for an ack message, and therefore might fail if the alarms we're attempting to acknowledge require notes. 
# Also, note that the system will ignore any alarms that have already been acknowledged.
 
if event.button==3:
   rows = event.source.selectedRows
   data = event.source.data
   if len(rows)>0:
      uuids = [str(data.getValueAt(r,'EventId')) for r in rows]
      def ack(event, uuids=uuids):
         import system
         system.alarm.acknowledge(uuids, None)
      menu = system.gui.createPopupMenu({'Acknowledge':ack})
      menu.show(event)
Panel
titleKeywords

system alarm acknowledge, alarm.acknowledge