It can happen that, for example, the level of a tank are stored in the PI Data Archive with different Unit of Measures (Tank 1 in mm and Tank 3 in cm). In the AF hierarchy you want to show the level of the tank in meters. To achieve this you have to configure the source Unit of Measure for each asset (AF element) individually. When you do this, the attribute is changing and lost its link AF template. The result of this is that updates of the attribute in the AF template will not be available in the attribute of the AF Element. The solution described below make it possible to configure the source Unit of Measure via an AF Template

 

First we have created an AF Table that contains references to the PIPoint and Unit of Measure of each tank. in this example it is an internal AF Table, but it can also be a reference to an external Excel sheet or table in a relational database (not tested, but it should be possible to get the tag name and eng. unit via PI OLEDB from the PI Data Archive). As you can see, tank 1 and 3 both using the Sinusoid tag, but the source Unit of Measure is different.

 

We are also creating a Tank template with a level attribute. This attribute will have 3 child attributes (PIPoint, Unit of Measure and ConfigString).

 

 

The PIPoint and Unit of Measure attribute retrieving the values via a Table Lookup data reference from the AF Table. The child attribute ConfigString does the trick. it concatenate the PI Data Archive name, PIPoint and Unit of Measure together into one string.

 

The value of the ConfigString attribute is used in the Level attribute.

 

The template is now ready and we can start creating instance of it.

 

 

The final result is shown in the picture below. All Levels are shown in cm. Tank 1 and 3 making use of the Sinusoid tag, but because of the difference in source Unit of Measure the shown level is different.