Cicode Programming Reference > Cicode Function Categories > Alarm Filter Functions > AlarmFilterOpen

AlarmFilterOpen

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 Citect 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 Filter

OpenMode

The values for OpenMode are:

AutoCloseMode

Values for AutoCloseMode are bit flags.

The values for the bits are:

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

See Also

Alarm Filter Functions

Published June 2018