Filter Functions when Browsing for Tags
Use
You can use a filter to restrict the number of hits in searches for tags in the namespace of the data source. PCo provides two types of filters:
-
Native Filter of the data source
-
Regex Filter (regular expression)
Integration
-
All agents except the OPC UA agent can use the Native Filter.
-
All agents can use the Regex Filter.
Features
Native Filter
The Native Filter is a source-specific filter. It is passed on directly to the data source. The data source filters the data and returns only those tags that meet the filter criteria. For this reason, the Native Filter is very advantageous in terms of performance. However, there is no uniform implementation of the Native Filter by the data sources. To understand the syntax of the filter, you need to read the documentation for the data server. Two Native Filters are described as examples:
-
OPC DA server from KEPWare
The filter enables you to search for a search term that occurs in the tag name.
It supports wild card searches: * (any character string), ? (any single character), # (any single numerical character)
-
PI server
The PI server provides an SQL-type filter logic with the following options:
-
The filter of the PI server can search for metadata of tags, meaning that you can search for tags using the instance of attributes.
-
The filter allows arithmetical comparisons such as pointtype > 12.
-
The filter allows the logical chaining of expressions.
-
The filter supports wildcards for strings, such as tag = 'sin*'. The exact filter logic and its possibilities are described in the documentation for the PI server.
-
Regex Filter
As a rule, the Regex filter cannot be evaluated by the data source, rather only in PCo using the functions provided by .NET for the regular expressions. In order for this filter to be used, the tags must already be loaded in PCo.
The advantage of this filter is that it follows a uniform syntax, namely that of the regular expressions. The syntax of the regular expressions under .NET can be found in the Microsoft documentation.
The disadvantage of this filter is that all the data from the data source must be read into the PCo system before the filter can be used for the data.
Uses of the Filter
You can use the filter on the following tabs in the PCo system:
-
Subscription Items tab
The Subscription Items tab is at the agent instance. It is used only in the notification process to select the tag or tags. When browsing to select the subscription items, the native filter is used (with the exception of OPC UA source systems). The PCo system displays the Filter field in the Browse dialog box. You can enter the filter criterion or criteria here.
PCo then displays only the tags that meet the filter criteria. See also: Agent Instance: Subscription Items Tab.
-
Aliases tab
The Aliases tab is in the source systems. This tab is used only in the query process. The native filter is used for browsing (with the exception of OPC UA source systems). You can restrict the selection of tags by entering a filter criterion in the Mask field.
PCo displays only the tags that satisfy the filter criteria. See also: Source System: Aliases Tab.
-
Tag Query tab
The Tag Query tab is at the agent instances. This tab is used only in the query process. See also: Agent Instance: Tag Query Tab.
The native filter is used in connection with the Cache Mode field (with the exception of OPC UA source systems).
If you enter Cache in the Cache Mode field and the value Tag00* as the filter criterion in the Mask field, for example, the native filter is used when the agent is started. All tags that meet the filter criterion are then loaded into the PCo cache.
You can use the Mask screen for the Cache Mode Cache only. When the agent instance is started, all tags that meet the filter criteria you specified in the Mask field are loaded into the PCo cache.
If you have set the Cache Mode to Alias, only the tags of the aliases selected in the Alias field are loaded into the PCo cache.
In the case of the cache modes Cache and Alias, static queries to PCo, such as queries pertaining to existing tags of applications (such as SAP MII), are no longer forwarded to the data source, they are handled directly via the PCo cache instead. This concept enables the namespace to be restricted and the destination system (for example, SAP MII) to access the tag information more quickly.
If you have set the Cache Mode to None or Demand, you cannot make any specifications regarding filter criteria since in these cases no tags are loaded into the PCo cache when the agent instance is started.