AlarmAckRec
- Last UpdatedJul 18, 2023
- 2 minute read
Acknowledges alarms by record number on both the primary and standby alarm servers. This function can be called from alarm server or client and should not be used with a MsgRPC() call to the alarm server.
This is a blocking function. If the function is called from a foreground task that is unable to block, an error will be returned.
Syntax
INT AlarmAckRec(LONG Record [, STRING ClusterName] )
Record:
The alarm record number, returned from any of the following alarm functions:
• AlarmFirstCatRec or AlarmNextCatRec: used to search for a record by alarm category, area, and type (acknowledged, disabled, etc.).
• AlarmFirstPriRec or AlarmNextPriRec: used to search for a record by alarm priority, area, and type (acknowledged, disabled, etc.).
• AlarmFirstTagRec or AlarmNextTagRec: used to search for a record by alarm tag, name, and description.
• AlarmGetDsp: used to find the record that is displayed at a specified AN, for either an alarm list or alarm summary entry. Set the sField argument in AlarmGetDsp to "RecNo".
To store this value, use data type Int in Cicode or Long for variable tags (Long needs 4 bytes).
ClusterName:
Specifies the name of the cluster in which the Alarm Server resides. This is optional if you have one cluster or are resolving the alarm server via the current cluster context. The argument is enclosed in quotation marks "".
Return Value
0 (zero) if successful, otherwise an error code is returned.
Related Functions
AlarmFirstCatRec, AlarmFirstTagRec, AlarmNextTagRec, AlarmGetDelayRec
Example
/* Acknowledge all unacknowledged (Type 1) alarms of the specified
alarm category. */
FUNCTION
AutoAccept(INT Category)
INT Current;
INT Next;
Current=AlarmFirstCatRec(Category,1);
WHILE Current<>-1 DO
Next=AlarmNextCatRec(Current,Category,1);
AlarmAckRec(Current);
Current=Next;
END
END