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

AlarmSumDelete

This command is deprecated in this version of CitectSCADA. Use the AlmSummaryDelete command instead.

Deletes an alarm summary entry. You identify the alarm summary entry by the Index, returned by one of the alarm summary search functions.

By embedding this function in a loop, you can delete a series of alarm summary entries. To start deleting from the oldest entry, call the AlarmSumFirst() function to get the index, and then call AlarmSumNext() in a loop. To delete back from the most recent entry, call AlarmSumLast() and then AlarmSumPrev() in a loop.

You can also get the Index from the AlarmSumFind() function, which finds an alarm summary entry by its alarm record identifier and time of activation.

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

AlarmSumDelete(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 the specified alarm entry exists, otherwise an error is returned.

Related Functions

AlarmSumFirst, AlarmSumNext, AlarmSumLast, AlarmSumPrev, AlarmSumGet, AlarmSumFind

Example

/* This function deletes all alarm summary entries that match the 
specified tag. */
FUNCTION
SumDelTag(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
AlarmSumDelete(Index);
END
Index=Next;
END
END

See Also

Alarm Functions