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

AlarmEnable

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.

1 - Enable a page of alarms. An alarm page can contain more than one alarm list:

2 - Enable a category of alarms.

3 - Enable alarms of a specific priority.

Alarm priority 0 indicates all priorities. Hardware alarms are not affected by priority. 3) Set Value to the group handle to enable a group of alarms of different priorities.

Value:

Used with Mode 0, 1 and 2 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:

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

0 (zero) if successful, otherwise an error code is returned.

Related Functions

GrpOpen, AlarmDisable, AlarmEnableRec

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);

See Also

Published June 2018