Base and derived templates
- Last UpdatedMay 21, 2025
- 3 minute read
- PI System
- PI Server 2018
- PI Server
A base template is best used when you are modeling elements that share most attributes, but have a few attributes that differ. A base template passes on all its attributes (as well as ports and analyses) to any derived templates that are created from it. When you later create an element from such templates, that element contains not only every attribute (as well as ports and analyses) from the base template, but also from the derived template.
Base template only (BTO) templates
To ensure certain templates are not used directly to create objects, you can assign the Base Template Only (BTO) property to a new template. Just like other base templates, a BTO template can be as broad or specific as needed and then used to create a derived template. When an instance of an object is created, it is based on the derived template, not the BTO template. Any modifications to a BTO template also alter its derived templates. The BTO property can be assigned to element, model, transfer, and event frame templates.
Note: A checkmark next to the Base Template Only check box on the General page of the Template Properties window indicates the template is a BTO template.
Base template example
Suppose you have a set of tanks, some with two valves and some with one valve: you can create an element template for the one-valve models, and use that as the base template for the derived template that you create for the two-valve models. When you create objects based on the two-valve model, they inherit all the attributes from the one-valve model, as well as any additional attributes defined for the two-valve model.
Derived templates
You define derived templates from a base template. You can designate a derived template after creating a base template using the following method:
-
Right-click a base template in the Library browser, then click New > New Derived Template.
-
The new template is immediately added to the Library browser with the new name BaseTemplate_Derived1.
You can modify the definition, including the name, as described in Create element templates.
Override of base-template attribute values
Situations may exist where you need to use attribute template values in a derived template that suppress or override attribute template values inherited from their base template. Consider the following situations:
-
Different substitution patterns are needed for PI points on the same type of asset (such as trucks with a common set of measurements, but truck manufacturer A uses a different PI point naming pattern than manufacturer B).
-
Some assets employ direct measurement for an attribute PI point, whereas others may need that attribute value to be calculated. Similarly, an attribute value may be calculated for both types of assets, but the calculation is slightly different between the two.
-
Different default UOMs or categories are needed for the same attribute, based on a template.
-
Not all attribute templates in a derived template are applicable (for example, some meters may only need three of the five attributes in a generic base template).
You override base template attribute values by creating an attribute template with exactly the same name in the derived template. You can then modify properties as needed.
You can also prevent an attribute template that has been inherited from a base template from being visible to users or a client application, such as AVEVA PI Vision, by creating an attribute template of the same name in the derived template and selecting Excluded as its Properties setting. For more information, see Excluded attribute property.
Template inheritance
By default, element templates are arranged by name in the Library browser. To determine the relationship that exists between templates, you might prefer
to arrange them by template inheritance instead. You can right-click the Element Templates collection and click Arrange By > Arrange By Template Inheritance. Expand templates with
beside them to reveal derived templates.