Create analyses (templates) with PI Builder
- Last UpdatedJan 11, 2023
- 3 minute read
- PI System
- PI Server 2024 R2
- PI Server
You can use PI Builder to create analyses (templates) based on an existing analysis (template) in an element (template).
-
Although it is possible to create a new analysis in PI Builder, we recommend first configuring an analysis in PI System Explorer and then importing it to Microsoft Excel using PI Builder to play with it.
-
By nature, analyses in PI Builder may not be very intuitive. Some examples are given below for your reference:
AnalysisRuleConfigString
AnalysisRuleVariableMapping
single variable
TagVal('att1')
VariableName||OutputAttributeName;
multiple variables
-
Variable1:=TimeEq('att1', '-1h', '*', 100);
-
Variable2:=TagVal('att1')
-
Variable1||OutputAttribute1;
-
Variable2||OutputAttribute2;
-
-
In PI System Explorer, create an analysis that is similar to the analyses you want to create.
You can base the analysis on an analysis template.
-
In Excel, retrieve the analysis on which you want to base other analyses:
-
On the PI Builder tab, click Elements > Find Elements.
-
In the Element Search window, find the element with the analysis (template) you want to use.
If you based the element on a template, you can search for elements that use that template. See Retrieve elements by searching for more information on search options.
-
In the Search results table, select the element and click OK.
You will use the analysis in the selected element to create similar analyses in bulk.
-
In the Overwrite or Append Data window, click Overwrite or Append.
-
-
In the Select Object Types and Column Headers window, select the worksheet column headers.
Make sure to select the Analysis check box.
-
If the element is based on a template, then select the Template check box in the Element group.
-
Click OK.
PI Builder inserts the selected column headers into the worksheet and retrieves the data for the selected element.
-
Click Close in the Retrieve Selected Objects window.
-
-
In the worksheet, set the worksheet values to define the analyses you want to create:
-
Fill in the Name column for as many analyses as you need.
Use Excel's copy and paste features to create the names that you need. For example, you can:
-
Name the analyses sequentially by pasting names with Excel's fill series option (select the AutoFill option on the Series window).
-
Copy and paste the names from a column in another worksheet.
-
-
In the Parent column, enter the element path.
This determines the element's place in the element hierarchy (see Learn about child elements). If the elements are all at the same level, then you can just copy and paste directly from the first element. Some guidelines:
-
List the parent objects before the child objects in the worksheet. PI Builder cannot create a child object before its parent object exists. PI Builder creates the objects in the order they appear in the worksheet.
-
When adding child objects to an existing parent object, you do not need to include the parent objects in the worksheet.
-
-
Set the ObjectType column to Analysis for all the analyses.
For analyses templates, set it to AnalysisTemplate.
-
Set the Template column to the name of the appropriate element template.
-
For AnalysisRuleVariableMapping to carry over, make sure you have created the output attributes in PI AF before mapping.
-
Set the Selected(x) column to for all the analyses that you want to create.
-
-
Publish the analyses to PI AF:
-
On the PI Builder tab, click Publish to open the Publish Options window.
-
From the Edit Mode list, select Create Only or Create and Edit.
-
Click OK to publish the analyses in the worksheet to PI AF.
PI Builder creates the analyses in PI AF and automatically checks in the changes.
-