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

AlarmSumAppend

Appends a new blank record to the alarm summary. Use this function to add new alarm summary entries, either for actual alarms or as special user summary entries.

If you specify a valid alarm tag in the sTag field, the summary entry is linked to the actual alarm. If you specify an asterisk '*' as the first letter of the tag, the summary entry becomes a user event.

User events are not attached to alarm records, so their status will not change. Manually change the status of the user event, by calling the AlarmSumSet() function with the index returned by AlarmSumAppend(). As user events are not attached to alarms, they don't have the alarm fields - so the AlarmSumGet() function will not return any field data.

The latest entry in the Alarm summary will reflect the events of the alarm whether the alarm summary entry was appended created by an actual alarm event.

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 needs to be set immediately after creation using the AlarmSumSet() function or AlmSummarySetFieldValue() function. These entries in the Alarm Summary cannot be filtered from the summary in an AlmSummaryOpen() browse session.

To give an appended alarm summary entry the appearance of having been Acknowledged set the Acknowledge time of the summary entry. When the summary entry is linked to an actual alarm the function AlmSummaryAck() can be used to acknowledge the actual alarm linked to the summary entry. However the AlmSummaryAck function will not directly affect the alarm summary entry.

AlarmSumAppend() 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

AlarmSumAppend(sTag [, ClusterName, OnTime, onMilli, bRedundant=true] )

sTag:

The alarm tag to append. Use an asterisk '*' as the first letter to append a user event to the alarm summary. Please be aware that if you using this 'user event mode' the AlarmSumAppend function returns the alarm summary index - not the error code.

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 "".

OnTime:

The alarm OnTime

OnMilli:

Milliseconds part of the alarm's ON time

bRedundant:

New alarm record is created on both redundant server instances.For backward compatibility with existing projects, redundancy can be switched off by calling AlarmSumAppend with bRedundant = false

Return Value

The index of the alarm summary entry, or -1 if the record could not be appended.

Related Functions

AlarmSumSet, AlmSummarySetFieldValue, AlmSummaryAck

Example

! Append alarm to summary display
AlarmSumAppend("CV101");
! Append user event
iIndex = AlarmSumAppend("*MyEvent");
AlarmSumSet(iIndex, "Comment", "My event comment");
AlarmSumSet(iIndex, "OnTime", TimeCurrent());

See Also

Alarm Functions