CtAPIAlarm
- Last UpdatedJul 13, 2023
- 2 minute read
Provides an interface into the alarm summary archive from external applications. For performance improvements, use the AlmQuery function instead.
To establish the query and return the first record, you call ctFindFirst. Then, to browse the remaining records, you call ctFindNext. To access the data of the current record, ctGetProperty is called for each field of the record.
ctFindFirst is called with the following parameters:
-
hCtapi: Handle to a valid CtAPI client instance.
-
szTableName: Command string for the almquery, see below.
-
szFilter: Not used for Almquery. Just pass in NULL.
-
hObject: Handle to the first record retrieved for the query.
-
dwFlags: Not used for Almquery. Just pass in 0.
The szTableName is the command string for the query and contains the parameters for the query.
Syntax
CTAPIAlarm(Category,Type,Area)
Note: Arguments needs to be comma-separated. Spaces between arguments are supported but not necessary. We recommend no spaces between arguments as they require more processing and take up more space in the query string.
Category:
The alarm category or group number to match. Set Category to 0 (zero) to match every alarm categorie.
Type:
The type of alarms to find:
Non-hardware alarms
1. Unacknowledged alarms, ON and OFF.
2. Acknowledged ON alarms.
3. Disabled alarms.
4. Configured alarms, i.e. Types 0 to 3, plus acknowledged OFF alarms.
If you do not specify a Type, the default is 0.
Area:
The area in which to search for alarms. If you do not specify an area, or if you set Area to -1, only the current area will be searched.
To simplify the passing of this argument, you could first pass the CTAPIAlarm() function as a string, then use the string as the szTableName argument (without quotation marks).