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

AlarmEventQue

Opens the alarm event queue. The Alarms Server writes events into this queue as they are processed. These events include activated, reset, acknowledged, enabled and disabled alarms. To read events from this queue, use the QueRead() or QuePeek() functions. The data put into the queue is the alarm record identifier (into the Type field) and the alarm event format (into the Str field). The function puts every state change into the queue and CitectSCADA does not use this queue for anything.

To use this function, you need to enable the alarm event queue with the [Alarm]EventQue parameter. This parameter will tell the Alarms Server to start placing events into the queue. The [Alarm]EventFmt parameter defines the format of the data placed into the string field. You can enable the EventQue parameter without setting the event format so that the Alarms Server does not place a formatted string into the queue.

Enabling this formatting feature can increase CPU loading and reduce performance of the Alarms Server as every alarm is formatted and placed in the queue. You should reconsider using this feature if a decrease in performance is noticeable.

The maximum length of each queue is controlled by the [Code]Queue parameter. You may need to adjust this parameter so as not to miss alarm events. When the queue is full, the Alarms Server will discard events.

 

UNINTENDED EQUIPMENT OPERATION

You may need to adjust the [Code]Queue parameter so as not to miss alarm events. When the queue is full, the Alarms Server will discard events.

Failure to follow these instructions can result in death, serious injury, or equipment damage.

Syntax

AlarmEventQue()

Return Value

The handle of the alarm event queue, or -1 if the queue cannot be opened.

Related Functions

QueRead, QuePeek, TagWriteEventQue

Example

hQue = AlarmEventQue()
WHILE TRUE DO
QueRead(hQue, nRecord, sAlarmFmt, 1);
/* do what ever with the alarm event */
...
Sleep(0);
END

See Also

Alarm Functions