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

AlarmSumNext

Gets the index of the next alarm summary entry, that is, the entry that occurred later than the entry specified by Index. You can use this index in the AlarmSumGet() function to get field data from an alarm record, in the AlarmSumSet() function to change the existing data in that record, or in the AlarmSumDelete() function to delete the record.

You can use this function to work with a series of alarm summary records. Call the AlarmSumFirst() or AlarmSumFind() function to get the index, and then call AlarmSumNext() within a loop, to move forwards in the alarm summary.

You can also get the index of an entry as soon as it displays on the alarm summary. Alarm summary entries are recorded with the most recent entry at the end of the list. Call AlarmSumLast() to get the index for the most recent entry, and then call AlarmSumNext() to get the index for the next entry that occurs.

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.

Note: The index passed to AlarmSum* functions must be current. ie either:
- the index returned by most recent call to AlarmSumFirst/Last/Find/Next/Prev, OR
- the index returned by the most recent call to AlarmSumAppend OR AlarmSumSplit

Syntax

AlarmSumNext(Index [, ClusterName] )

Index:

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

Note: If the supplied index was returned by AlarmSumAppend, AlarmSum Next and AlarmSumPrev will return -1, and an error (561, invalid index) is raised. To retrieve extended error information, call IsError().

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

The index of the next alarm summary entry or -1 if no more alarm summary entries are found.

Note: The index is a 32-bit integer. Storing it in a variable that is smaller than 32 bit integer (such as a 16-bit integer) may cause overflow which may result in an incorrect value.

Related Functions

AlarmSumCommit, AlamSumDelete, AlarmSumSet, AlarmSumType, AlarmSumAppend, AlarmDelete, MsgRPC, AlarmSumGet, AlarmSumFirst, AlarmSumLast, AlarmSumPrev, AlarmSumFind, AlarmSplit, AlarmSumSplit

Example

See AlarmSumFirst

See Also

Alarm Functions

Published June 2018