AlarmFilterOpen
- Last UpdatedJul 18, 2023
- 2 minute read
This function creates a named filter. The filter is initialized with empty content (matches all alarms). If unable to open the named filter an error code is returned.
See the topic About Named Filters in the main Plant SCADA help for more information about filter syntax.
Note: If a requested filter is too complex (for example, it contains too many conditions or too many nested brackets), the filter is cleared (no filter is used). The hardware alarm "Too many alarms in filters" is generated on the client components, and a tracelog error message is logged.
Syntax
INT AlarmFilterOpen(STRING FilterName, INT OpenMode [, INT AutoCloseMode])
FilterName
Name of the filter.
OpenMode
The values for OpenMode are:
0 - Open an existing named filter.
1- Create a new named filter.
2- Attempts to open an existing named filter. If the named filter does not exist, a new named filter is created.
AutoCloseMode
Values for AutoCloseMode are bit flags.
The values for the bits are:
• 0 bit - Will not automatically close filter. Use AlarmFilterClose.
• 1 bit - When set, the named filter will be closed when the page is changed or otherwise closed.
Note: All other modes are reserved.
Return Value
0 (zero) if the filter was opened or created or an error if unsuccessful.
Example
// This example shows how to open and close the named filter "Myfilter"
// nothing of interest is done with the filter in this example.
INT nOpenModeOld = 0;
INT nOpenModeNew = 1;
INT nOpenModeAny = 2;
INT nCloseModeManual = 0;
INT nCloseModePageChanged = 1;
INT nError;
nError = AlarmFilterOpen("MyFilter", nOpenModeNew, nCloseModeManual);
IF nError = 0 THEN
nError = AlarmFilterClose("MyFilter");
END
Related Functions
AlarmFilterClose, AlarmSetInfo