AlmArray

Description:              Returns alarm list information in a two-dimensional array.

Returns:                    Array  (two-dimensional)

Usage:                       Script

Format:                      AlmArray(List, Standard)

Parameters:             List    { numeric }  { required }  { no default: }

                                                Any numeric expression giving the list number to search for the alarm. The valid list numbers are:

List

Meaning

0

Logged alarm list

1

Active alarm list

2

Unacknowledged alarm list

3

Current alarm list

 

                             You may add any of the following numbers to the specified list number to filter the selected list.

List

Attributes

4

Use combined alarm list

8

Don't include alarm occurrences in list

16

Don't include alarm clears in list

32

Don't include alarm acknowledges in list

64

Don't include alarm enables in list

128

Don't include alarm disables in list

                             Standard   { numeric }  { required }  { no default: }

                                                Any numeric expression that denotes the format to be used in the array:

Standard

Format

0

Non-standard column-by-row format (where each alarm is a column).

1

Standard row-by-column format (where each alarm is a row).

 

Comments:            The lowest dimension of the returned array is used to index specific alarm messages, while the highest dimension is used to index one of the following alarm attributes:

Element

Attribute

0

Unique alarm identifier

1

Alarm category (0 – 255)

2

Alarm date/time (in seconds since Jan. 1, 1970)

3

End date/time (in seconds since Jan. 1, 1970

4

Alarm event type (see below)

5

Alarm level (0 – 15)

6

Alarm message 1

7

Alarm value

8

Alarm message 2

9

Alarm status (see below)

 

                             The unique alarm identifier can be used to acknowledge specific alarm messages using the AlmAckID statement.

                             The alarm event type (element 4 in the list above) indicates the type of event that has occurred, depending upon which of its bits are set. The bit numbers are displayed in the list below:

Alarm Event Type #

Bit No.

Alarm Event Type

0

-

Alarm enabled

1

0

Alarm disabled

2

1

Alarm acknowledged

4

2

Alarm cleared

8

3

Alarm occurrence

 

                             For example, an alarm event type value of 8 (bit 3 set) would mean that an alarm has occurred; a value of 1 (bit 0 set) would mean that an alarm has been disabled; a value of 0 (no bits set) would mean that an alarm has been enabled; and so forth. At the same time that an event (such as an alarm being cleared (bit 2 set)) is recorded, the record where the alarm occurred will change from a value of 8 (alarm occurrence), to a value of 12 (alarm occurred and was cleared).

                             The alarm status is similar to the alarm event type. The alarm status value keeps track of the status of the alarm at that point, without having to look back to the original line in the list where the alarm occurred. The alarm status value is interpreted as follows:

Alarm Status #

Bit No.

Alarm Status

1

0

Unacknowledged alarm

2

1

Disabled alarm

4

2

Active alarm

8

3

<obsolete>

16

4

Reserved (value unknown)

 

 

Example:

almInfo { Do not declare as array };

...

If flag;

[

  almInfo = AlmArray(2, 1  { Unacknowledged alarm list });

  almCount = NumAlarm(2, 0, 15, 0, 255 { Count acknowledged  

                       alarms });

  flag = 0;

]

Table(almInfo[6] { Display alarm message 1 },

      almCount { All unacknowledged alarms },

      50, 50 { First line's coordinates },

      0, 10 { Display vertically },

      4 { Text },

      0, 20 { Min and max number of chars },

      15, 0, 0, 0, 0 { Text color and attributes });

In the example above, the statements display the message 1 portions of all unacknowledged alarms.

See Also:

Alarm | AlarmCat | AlarmInst | AlmAck | AlmAckID | AlmCatName | AlmColor | AlmEnable | AlmList | AlmTone | NumAlarm | Table