Cicode Programming Reference > Cicode Function Categories > Alarm Functions Introduction > AlarmQueryFirstRec


Searches for the first occurrence of an alarm category (or priority) and type. This is a wrapper function of AlarmFirstCatRec and AlarmFirstPriRec.

When the Alarm Server is not in the calling process, this function will become blocking and cannot be called from a foreground task. In this case, the return value will be undefined and a Cicode hardware alarm will be raised.


AlarmQueryFirstRec(Group, Type, Area, QueryType [, ClusterName] )


Alarm category if QueryType is 0 or alarm priority if QueryType is 1.


Type of alarms to find:

Non-hardware alarms

0 - All active alarms; that is, types 1 and 2.

1 - All unacknowledged alarms, ON and OFF.

2 - All acknowledged ON alarms.

3 - All disabled alarms.

4 - All configured alarms; that is, types 0 to 3, plus acknowledged OFF alarms.


Area in which to search for alarms. Set Area to -1 to search all areas.


Query type.

0 - Search by category.

1 - Search by priority.


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

The alarm record identifier or -1 if no match is found.

Related Functions


See Also

Alarm Functions