AlarmEnable
- Last UpdatedSep 09, 2025
- 2 minute read
Enables an alarm on the active alarm list. You can enable the alarm where the cursor is positioned, one or more alarm lists on the active page, a whole category of alarms, or alarms of a particular priority.
No action is taken if the alarms are already enabled. You would normally call this function from a keyboard command.
If this function is not called from a foreground task, it becomes a blocking function.
Syntax
INT AlarmEnable(INT Mode, INT Value [, STRING ClusterName [, INT bAcknowledge]] )
Mode:
The type of enable:
0 - Enable a single alarm where the cursor is positioned.
• Set Value to the AN where the alarm list is displayed.
• Set Value to 0 to enable the alarm at the current cursor position.
1 - Enable a page of alarms. An alarm page can contain more than one alarm list:
• Set Value to the AN where the alarm list is displayed.
• Set Value to 0 to enable the (displayed) alarm list (on the active page) where the cursor is positioned.
• Set Value to -1 to enable all (displayed) alarm lists on the active page. This only applies to alarm lists created using AlarmDsp (and not those created using AlarmDspLast).
2 - Enable a category of alarms.
• Set Value to the alarm category (0-16375) of the alarms to be enabled. Alarm category 0 indicates all categories; alarm category 255 indicates hardware alarms.
• Set Value to the group handle to enable a group of categories.
3 - Enable alarms of a specific priority.
Hardware alarms are not affected by priority.
• Set Value to the alarm priority (0-255) of the alarms to be enabled. Alarm priority 0 indicates all priorities.
• Set Value to the group handle to enable a group of alarms of different priorities.
Value:
Used to specify which alarms to enable.
ClusterName:
Used with Mode 2 or 3 to specify the name of the cluster where the alarms being enabled reside in. This argument is optional if the client is connected to only one cluster containing an Alarm Server or are resolving the alarm server via the current cluster context.
This argument is not required where the Mode is 2 and the value is 255 (hardware alarm category).
This argument is enclosed in quotation marks "".
bAcknowledge:
Forces acknowledgment of an alarm after it is enabled. The accepted values are:
0 — (default) enforced acknowledgment will not be applied.
1 — alarm will be acknowledged when enabled.
Return Value
Alarm commands on single clusters will return either 0 if successful or an error code if unsuccessful.
Alarm commands across multiple clusters may also return a partial success result, whereby a command has been successful on 'at least' one cluster but unsuccessful on another cluster.
Related Functions
GrpOpen, AlarmEnableRec, AlarmEnableTag, AlarmDisable, AlarmAck, AlarmClear
Examples
// Enable the alarm where the cursor is positioned
AlarmEnable(0, 0);
// Enable a page of alarms
AlarmEnable(1, -1);
// Enable category 3 alarms in cluster XYZ
AlarmEnable(2, 3, "XYZ");
// Enable the alarm where the cursor is positioned and enforce acknowledgment
AlarmEnable(0, 0, "Cluster1", 1);