Cicode Programming Reference > Cicode Function Categories > Alarm Functions Introduction > AlarmSumCommit

AlarmSumCommit

Commits the alarm summary record to the alarm summary device. Alarm summaries are normally written to the alarm summary device just before they are deleted from the summary queue. The length of time that alarm summary entries remain in the alarm summary queue is controlled by [Alarm]SummaryTimeout parameter.

This function allows you to commit the alarm summary records now, rather than when they are deleted from the queue.

This function can only be used if the Alarm Server is on the current machine. When the Alarm Server is not in the calling process, this function will become blocking and cannot be called from a foreground task. In this case, the return value will be undefined and a Cicode hardware alarm will be raised.

Syntax

AlarmSumCommit(Index [, ClusterName] )

Index:

The alarm summary index (returned from the AlarmSumFirst(), AlarmSumNext(), AlarmSumLast(), AlarmSumPrev(), AlarmSumAppend(), or AlarmSumFind() function).

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 is returned.

Related Functions

AlarmSumFirst, AlarmSumNext, AlarmSumLast, AlarmSumPrev, AlarmSumGet, AlarmSumFind

Example

/* This function commits alarm summary entries that match the
specified tag. */
FUNCTION
SumCommitTag(STRING sTag)
INT Next;
INT Index;
STRING Name;
Index=AlarmSumFirst();
WHILE Index<>-1 DO
Name=AlarmSumGet(Index,"Tag");
Next=AlarmSumNext(Index);
IF Name=sTag THEN
AlarmSumCommit(Index);
END
Index=Next;
END
END

See Also

Alarm Functions