Tag Naming tab
- Last UpdatedMar 07, 2023
- 6 minute read
- PI System
- PI AutoPointSync 1.2.8
- Interfaces
The Tag Naming tab specifies tag naming rules for available points. Not all PI APS Connectors support this feature (some PI APS Connectors provide connector-specific alternatives). If the PI APS Connector for the selected interface does not support the tag naming feature, this tab is unavailable.
The list in this dialog box contains the tag naming rules configured for the selected interface. Each tag naming rule has a condition part and a tag formula part. If the attributes for a data source tag satisfy one of the conditions, the tag formula associated with the condition is used to construct the tag name for the available point. The tag naming rules are processed in the order shown in the list. The tag formula associated with the first true condition is used to construct the tag name. Therefore, more restrictive conditions must be ahead of less restrictive conditions in the list.
The syntax for condition expressions is:
[DataSourceAttribute1] operator 'text pattern' AND [DataSourceAttribute2] operator 'text pattern' AND ...
Data source attribute names must be in square brackets (consult the user guide for the specific PI APS Connector for a list of data source attributes that are supported by the PI APS Connector).
The valid operators are.
LIKE
=
<>
>
>=
<
<=
Each text pattern must be enclosed in single quotes. The single quotes are required even if the data source attribute is numeric and the text pattern is the string representation of a number.
If the data source attribute is string-valued and the operator is , , or , the text pattern can contain wildcard characters and . The wildcard characters have their usual interpretations: matches any zero or more characters, and matches any one character. Operators and are true if the data source attribute value matches the text pattern. Operator is true if the data source attribute value does not match the text pattern.
When a string-valued data source attribute is used with operators >, >=, <, or <=, characters or in the text pattern are taken literally, not as wildcards.
The wildcard characters are illegal in the text pattern operand for a numeric data source attribute.
The operator with a floating-point attribute is an "almost equal" operator. That is, tests for the absolute difference between the attribute value and reference value (in the text pattern) being less than 10-6 times the reference value. This provides some margin for dealing with the imprecision of floating-point representation.
An example condition expression is:
[PointName] = 'ABC??X-*' AND [NetworkNumber] > '5'
This example assumes that the PI APS Connector supports data source attributes named PointName and NetworkNumber. The PointName attribute must be string-valued.
A tag formula is composed of literal text and data source attributes in any order. Literal text in a tag formula is not enclosed in quotes (or brackets) and cannot contain characters that are illegal in PI point names. A data source attribute must be an attribute name defined by the PI APS Connector enclosed in square brackets. During construction of an actual tag name, the data source attributes are replaced with the tag's data source attribute values.
For example, the tag formula
TAG1:[PointName].[NetworkNumber]_tag
applied to a tag with a data source PointName attribute value of OVATION123 and a data source NetworkNumber attribute value of 3 would construct the tag name
TAG1:OVATION123.3_tag
If more than one condition is true for the data source attribute values for a tag, the first true condition in the list is used for tag naming. If no condition is true for the current tag's data source attributes, the PI APS Connector's default rule for tag naming is used (see the user guide for the specific PI APS Connector). You can override the default tag naming rule by adding a condition that is always true to the end of the conditions list. For example,
[PointName] = '*'
To add a new tag naming rule to the list, fill in the Condition and Formula boxes and click Add. If the condition expression or tag formula is invalid, the background color of the box changes to yellow and the Add button becomes unavailable.
Rather than typing condition expressions or tag formulas, you may prefer to use the expression builder dialog boxes that the Build buttons open. Each build button opens a dialog box specific to the expression box to its left.
Note: You must click Add to create a new tag naming rule from the Condition and Formula expressions, regardless of whether they were entered manually or by an expression builder dialog box.
When you click the Build button next to the Condition box, the Condition Builder dialog box opens.
This dialog box builds a condition expression by adding condition expressions one at a time. The Data Source Attributes list contains the data source attributes supported by the PI APS Connector for the selected interface. The second list contains valid operators. Select an attribute, an operator, and enter a value (without quotes) in the third box.
Note: This dialog box does not check for validity of the value in the third box.
Click Add to construct an expression of the form
DataSourceAttribute operatortext pattern.
If the large box is not empty, the new expression is prefixed with an operator. Each new expression you add is appended to the expression in the large box. Regardless of the location of the insertion cursor in the large box, new subexpressions are always added to the end of the expression in the large box.
The large box is editable. After a subexpression is entered, the only way to delete or change it is to edit the large box.
When you click OK, the expression in the large box is copied into the Condition box on the Tag Naming tab.
Note: If you click OK before you click Add to append a new expression to the large box, any data in the data entry boxes are lost. Clicking OK on the dialog box as shown above copies an empty expression into the Condition box on the Tag Naming tab.
When you click the Build button next to the Formula box, the Formula Builder dialog box opens.
This dialog box operates similarly to the Condition Builder dialog box. When you click OK, the tag formula in the large box is copied into the Formula box on the Tag Naming tab. The large box can be edited.
The Data Source Attributes list contains the data source attributes supported by the PI APS Connector for the selected interface. Choose a data source attribute and then click the Add button underneath the box to enter the attribute into the tag formula. Unlike the Condition Builder dialog box, which always appends to the end of the condition expression, the Formula Builder dialog box adds the attribute name at the insertion cursor in the tag formula (not necessarily the end). Similarly, text can be entered in the Text box and then inserted into the tag formula by clicking the Add button under the Text box. Alternately, literal text can be typed directly into the tag formula.
Returning to the Tag Naming tab on the User-set Defaults dialog box, to edit or delete a tag naming rule in the list, first click on the rule to select it. Then click the Delete or Edit button. The Edit button opens this dialog box:
The Condition and Formula boxes can be edited in this dialog box. Alternatively, click the Build button to the right of either box to open the respective Condition Builder or Formula Builder dialog box. The current expression is not carried into either builder dialog box. The builder dialog boxes can only be used to build entirely new expressions that replace the current expression.