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

AlarmSumSet

Sets field information in 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 change field data in a series of alarm summary entries. To start from the oldest entry, call the AlarmSumFirst() function to get the index, and then call AlarmSumNext() in a loop. To work back from the latest 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.

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.

Fields of an appended alarm can only be set using this function or the replacement function AlmSummarySetField().

You can use user events to keep a record of logins, or control operations that you need to display in the alarm summary etc. The fields of UserEvents need to be set immediately after creation using this function. These entries in the Alarm Summary cannot be filtered from the summary in an AlmSummaryOpen() browse session.

Note: In a redundant pair scenario, this function will return an error condition and not do anything if the current server is not main. You can call this function on the primary server and the standby server so that function can succeed on one of the two servers in the specified cluster. The change will be synchronised to the other server after a short period of time (typically in 5 seconds).

Note: This function will only work while the record is writable which is controlled by the ArchiveAfter Parameter. Refer to the topic Configure the Archiving Parameters in the main help for more information.

Syntax

AlarmSumSet(Index, sField, sData [, ClusterName] )

Index:

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

sField:

The name of the field in which data is to be set:

AckTime

Alarm acknowledged time

Comment

Alarm comment

OffMilli (for time stamped alarms only)

Alarm millisecond off time

OffTime

Alarm OFF time

sData:

The new value of the field.

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 alarm summary entry exists, otherwise an error is returned.

Related Functions

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

Example

See AlarmSumFirst

See Also

Alarm Functions

Published June 2018