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

AlarmDisable

Disables alarms. You can disable 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.

You would normally call this function from a keyboard command. No action is taken if the alarms are already disabled. Use the AlarmEnable() function to re-enable an alarm.

After you disable an alarm, the behavior is determined by the [Alarm]DisplayDisable parameter for your system to choose between taking the alarm off scan or suppressing it from the active alarm display.

If this function is not called from a foreground task, it becomes a blocking function.

Syntax

INT AlarmDisable(INT Mode, INT Value [, STRING ClusterName [, INT EndTime [, STRING Comment]]] )

Mode:

The type of disable:

0 - Disable a single alarm.

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

2 - Disable a category of alarms.

3 - Disable alarms of a specific priority.

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

Value:

Used with Mode 1 and 2 to specify which alarms to disable.

ClusterName:

Used with Mode 2 or 3 to specify the name of the cluster where the alarms being disabled reside in. This argument is optional if the client is connected to only one cluster containing an alarm server, or if the alarm server is resolved via the current cluster context.

This argument is not required where:

This argument is enclosed in quotation marks "".

EndTime:

A date/time variable that indicates when the alarm will no longer be disabled. If this parameter is omitted or set to 0, the alarm will be disabled indefinitely.

Comment:

An optional comment limited to 200 characters explaining why the alarm is disabled. If the comment exceeds 200 characters, hardware error 274 ("Invalid argument passed") will be displayed.

Return Value

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

Related Functions

GrpOpen, AlarmEnable, AlarmDisableRec

Examples

// Disable the alarm where the cursor is positioned
AlarmDisable(0, 0);

// Disable a page of alarms
AlarmDisable(1, -1);

// Disable category 3 alarms in cluster XYZ
AlarmDisable(2, 3, "XYZ");

// Disable the alarm where the cursor is positioned for the next 60 minutes
nEndTime = DateAdd(TimeCurrent(), 3600);
AlarmDisable(0, 0, "Cluster1", nEndTime, "Shelve alarm for 60 minutes.");

// Disable a page of alarms until 20 Dec 2016 6:30am local time
nEndTime = DateAdd(StrToDate("20/12/2016"), StrToTime("6:30"));
AlarmDisable(1, -1, "Cluster1", nEndTime, "Shelve alarms until 20 Dec 2016 6:30am");

See Also

Published June 2018