For historical event lists, you can define and apply a filter (the filter is not shared between lists). The filter is a combination of conditions on the different fields which define the set of rows to display. These conditions may become large, with Cicode only permitting a string of 254 characters. The set / append functions allows you to separate the filter into smaller pieces without verification of the syntax on the sub parts. The whole filter (e.g. concatenation of the pieces) is validated and applied later by the commit function.
Multiple Cicode tasks can access the same filter and modify it, with the filter browsing and modification part of a session. This follows the principles used in tag browsing.
Filter Syntax
The filter expression may contain a field, comparison operator and a value e.g. Tag=A. The field can be any name listed in the Browse Field Reference, with comparison operators being < <= > >= = <>, and value being either a String, Integer, Date Time, and Boolean. Tag Value pairs can be connected by logical operators AND OR Eqv NOT Xor.
A filter may contain multiple expressions separated by a semi colon.
The syntax of the filter can be verified against the following:
Note:
• (1) The ";" between <filter_expr> is interpreted as AND
• (2) The parenthesis are optional but recommended to obtain the right evaluation order. If they are present they need to match.
• (7) The "*" is standard wild card. it can be use only once per <string_value>
| <comparison>
| "NOT" "(" <filter_expr>")"}
| " ’ " <singleword> { {" <space>"} <singleword>["*"] } " ’ "
as returned by IntToStr( TimestampToTimeInt(..)) in UTC
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). If this occurs, the hardware alarm "Too many alarms in filters" is generated on the client components, and a tracelog error message is logged.
Valid filters examples:
When using the alarm filter Cicode functions first open a session (AlmFilterOpen) and then use this session to browse the different parts (AlmFilterFirst/Next/Prev) of the filter and to update (AlmFilterSet / Append / Commit) the filter. The browse session will be available until closed (AlmFilterClose).
Multiple sessions can be used on the same list. For multiple sessions modify the same filter then the current applied filter is the result of the last commit.
See Also
Published June 2018