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

AlarmSetThresholdRec

Changes the threshold (that is High High, Low etc.) of analog alarms by the alarm record number. You can call this function only on an Alarms Server for alarms on that server, or on the redundant server (if a redundant server is configured). 

Threshold changes made using this function are permanent (that is they are saved to the project). The display format currently specified for the record (in the Analog Alarms form) will be applied to these values.

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

This is a blocking function. If the function is called from a foreground task that is unable to block, an error will be returned.

To permanently update alarm threshold limits using AlarmSetThresholdRec(), set the parameter [Alarm]UseConfigLimits to 1.

Syntax

INT AlarmSetThresholdRec (LONG Record, INT Type, STRING Value [, STRING ClusterName])

Record:

The alarm record number, returned from any of the following alarm functions:

To store this value, use data type Int in Cicode or Long for variable tags (Long needs 4 bytes).

Type:

The type of threshold:

0 - High high

1 - High

2 - Low

3 - Low low

4 - Deadband

5 - Deviation

6 - Rate of change

Value:

The new value of the threshold. Enter a blank value "" to remove the threshold.

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

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

Related Functions

AlarmSetThreshold

See Also

Alarm Functions

Published June 2018