Cicode Programming Reference > Cicode Function Categories > Alarm Functions > AlarmFirstTagRec

AlarmFirstTagRec

Searches for the first occurrence of an alarm tag, name, and description. 

This is a blocking function. If the function is called from a foreground task that is unable to block, the return value will be -1 and a hardware alarm set. Use IsError() to retrieve the error code.

Note: Record numbers obtained from AlarmGetDsp are not valid for this function.

This function returns an alarm record identifier that you can use in other alarm functions, for example, to acknowledge, disable, or enable the alarm, or to get field data on that alarm.

Note: This function will return a match for an Acknowledge Off alarm with [Alarm]AckHold=1 even after it has been cleared using AlarmClear or AlarmClearRec.

For complex filtering operations it is more efficient to use the alarm tag browse functions AlmBrowseOpen and AlmBrowseNext.

Syntax

LONG AlarmFirstTagRec(STRING Tag, STRING Name, STRING Description [, STRING ClusterName] )

Tag:

A string that identifies the tag to be matched. It can be one of the following:

Specify an empty string (" ") to match all alarm tags.

Name:

The alarm name to be matched. Specify an empty string (" ") to match all alarm names.

Description:

The alarm description to be matched. Specify an empty string (" ") to match all alarm descriptions.

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

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

Note: The order in which alarms are returned has changed from version 7.20. In later versions, unacknowledged alarms are no longer returned first.

Related Functions

AlarmNextTagRec, AlarmGetFieldRec, AlarmAckRec, AlarmDisableRec, AlarmEnableRec, AlarmGetThresholdRec, AlarmSetThresholdRec, AlmBrowseOpen , AlmBrowseNext

Example

See AlarmDisableRec

See Also

Alarm Functions

Published June 2018