Skip navigation
All People > dfsoll > David Soll's Blog > 2017 > December
2017

In addition to AF Elements being able to inherit an AF Element Template properties, AF Element Templates can inherit other AF Template properties and actually build a hierarchy of AF Templates.  Using this principle can be helpful in building an infrastructure that is easier to maintain and much more robust.

 

Two Rules of Thumb:

  1. Never create an AF Element that does not inherit its properties from an AF Element Template
  2. Create a single "root" AF Template that ALL other templates inherit from

 

When ensuring that all elements inherit from a template, you guarantee that you can make global changes to you AF structure without having to edit every element.  When all element templates are inherited from a single template, you now have a mechanism to easily affect every element in your database.

dfsoll

Creating PI tags from AF

Posted by dfsoll Dec 8, 2017

Did you know that you can use AF to create PI tags. AF has a mechanism to be able to easily create tags and through the use
of templates and substitution parameters, it can make building a PI data archive database much simpler.  The best
way to accomplish this is to utilize templates that describe all of the attributes for a PI tag in each of the attributes.  You will likely need to use formulas that
will resolve when the AF element is created using the template.

 

When
you define an attribute that is to be a PI point created by AF, you should include more than just the tag in the configuration string.  Typically when configuring a PI point attribute in an AF Element Template, you would use something like "\\%Server%\%Element%.%Attribute%" where items inside of the percent signs are substitution parameters.  In this default case, it replaces %Server% with the name of the default PI data archive server, the %Element% with the name of the element that instantiates the template, and %Attribute% with the name of the attribute.  There are more substitution parameters available which I'll discuss in a future blog.

 

If you intend the attribute to create a PI point, you should append the configuration string with settings for the point's attributes, each attribute separated by a semicolon.  For example: \\%Server%\%Element%.%Attribute%";PointType=float32;PointSource=OPC1;Location1=1;Location4=1"

 

It should be noted that the substitution parameters do not only work for the server name and the tag, but they can be used anywhere within the configuration string.  So you could use the following where some of the attributes for the point can be contained in a child attribute such as: \\%Server%\%Element%.%Attribute%";PointType=%@.|PointType%;PointSource=%@.|PointSource%;Location1=%@.|Location1%;Location4=%@.|Location4%".  In this example, the attribute would have child attributes for each PI point attribute (i.e.: PointType, PointSource, Location1, and Location4).