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

AlarmGetInfo

Gets data on the alarm list displayed at a specified AN. Use this function to display the current alarm list information on an alarm page. If only one alarm list has been configured on an alarm page, modes 2 and 3 of this function return the current alarm page information.

Note: You cannot retrieve the order by key setting for an alarm list using this function, as it can only returns numeric values. To retrieve this information, use the function AlarmGetOrderbyKey.

If this function is not called from a foreground task, it becomes a blocking function.

Syntax

LONG AlarmGetInfo(INT AN, INT Type [, STRING ClusterName])

AN:

The AN where the alarm list (with the required information) is displayed. Set the AN to 0 (zero) to get information on the alarm list where the cursor is positioned.

Type:

The type of data:

0 - Alarm page number. The vertical offset (in pages) from the AN where the alarm list commenced. The alarm list need to have scrolled off the first page for this type to return a non-zero value.

1 - Alarm list offset. The vertical offset (in lines) from the AN where the alarm list commenced. You need to have scrolled off the first page of alarms for this type to return a non zero value.

2 - Category of alarms displayed on the alarm list. You can use a group number to display a group of categories.

3 - Type of alarms displayed on the alarm list. See AlarmDsp() for a list of these types.

7 - Priority of alarms displayed on the alarm list. The return value may be a group number if the alarm list contains alarms of more than one priority.

8 - Display mode of the alarm list.

9 - Sorting mode of the alarm list.

10 – Reading this field is invalid, use the function AlarmGetOrderbyKey.

11 – Retrieves the error code for the last alarm summary request that was not able to be processed due to a buffer overflow. The last request error value will be reset on the next successful response from the servers.

12 – Returns values as follows:

13 – Returns values as follows;

14 - Identifies if the data is available for a particular cluster. Returns 1 if data is ready, or 0.

15 – Auto-refresh mode, where mode is:

Note: Type 15 is only in use if displaying the alarm summary (AlarmDsp Type 10).

16 – Timeout occurred. This value is set to 0 when a data fetch is initiated for the supplied alarm list (indicated by AN). This value is set to 1 if a timeout occurs within the fetch. The timeout period is specified by the INI parameter [Alarm]AlarmListRequestTimeout.

17 – Alarm page number for specified AN is displayed. When the alarm list is scrolled by vertical offset (in lines), the list may span across two pages of alarms. Calling this function returns the page number of the alarm list that the specified AN is displaying. This differs to Type 0 which returns the page number based on the first line of the alarm display.

ClusterName:

Specifies the name of the cluster in which the Alarm Server resides. This is only required for type 14. The argument is enclosed in quotation marks "".

Return Value

Alarm list data as a numeric value.

Related Functions

AlarmDsp, AlarmSetInfo, AlarmGetOrderbyKey.

Example

/* In the following examples, data is returned on the alarm
list where the cursor is positioned. */
page = AlarmGetInfo(0,0);
! returns the alarm page number.
offset = AlarmGetInfo(0,1);
! returns the alarm list offset.
cat = AlarmGetInfo(0,2);
! returns the alarm category displayed.
type = AlarmGetInfo(0,3);
! returns the type of alarms displayed.

See Also

Alarm Functions

Published June 2018