vwolf

Find AF Attributes and AF Analyses that reference a PI Point

Blog Post created by vwolf on Jan 16, 2020

Sometimes AF Hierarchies get so big that we lose track of where some PI Points were referenced. I created a PowerShell script to help identify Attributes and Analyses that read from a PI Point on an AF Database, by searching an XML file export of said database. There are, of course, several methods to achieve this same outcome, but I believe this method here has some advantages:

  • Easy to read and edit (compared to an executable file/compiled program)
  • Handles a huge amount of data (compared to Excel/PI Builder)
  • Does not need an active connection to AF (compared to using AF SDK)
  • It is fast (plain text operations and no network connection required)

 

The script is attached to this blog post. You will need some previous knowledge with PowerShell if you want to use it.

 

Usage:

  1. Perform a "Create or Update Data Reference" on the top level of the AF Database Hierarchy ("Elements"). This is important because otherwise, the Attribute's configuration string might not contain the PI Point name if the Attribute derives from a template.
  2. Export the AF Database to an XML File (File > Export to file...). Just the standard export, do not include any options
  3. Input the correct information on the "User-Defined Variables" section of the script (XML File Path and PI Point Name) and run it

 

Limitations:

  1. The script only returns Analyses that belong to the same Element as the Attribute containing the PI Point (as opposed to Analyses that reference the Attribute from another level of the Hierarchy).

 

I hope this helps you administer your PI System! 

 

If you improve this script, let me know by commenting on this page! 

Outcomes