PI System Calculations
PI System Calculations
provide a powerful way to transform data on the fly without the need to set up calculations in AF Analytics. IOTA allows you to quickly apply mathematical operations to PI points or attributes, enabling immediate, real-time insights into your processes.
Note: This functionality is currently available only for PI tags and assets and only in the current view. To create calculations with other data sources across assets or displays, please use the Python driver.
Important:
- All PI points used in a calculation must originate from the same Data Archive.
- Assets in a calculation must come from the same AF database.
- Mixing PI points and assets in the same expression is not supported.
Creating a Calculation
Follow these steps to create and configure a new calculation:
1. Access the Calculation Editor
- Navigate to the Search tab located in the left pane.
- Select the Calculation tab below.
- Click the + icon to add a new calculation. The Calculation Editor window will appear.

2. Select Data for the Calculation
- On the left side, you'll find the Data Search area. Choose the data type you want to use for the calculation.
- Define the data source and search for the data as you typically do. For more information on how to search for data, see Search.

3. Name and Describe the Calculation
- Provide a meaningful name for the calculation.
- Add a description to easily identify it later.

4. Define the Expression
Drag and drop the desired attributes or PI points into the Expression field.
Construct your calculation expression using these attributes and appropriate mathematical operators.

Creating a calculation expression is similar to writing a standard arithmetic equation. You can use arithmetic operators such as +
, -
, *
, /
, and functions like Sqrt()
or Sin()
.
Expressions consist of operands (the data points or attributes) and operators (the mathematical symbols).
Basic Expressions
- Addition: 'TagPressure' + 'TagTemperature' adds the values of TagPressure and TagTemperature.
- Subtraction: 100 - 'TagFlowRate' subtracts the value of TagFlowRate from 100.
- Multiplication with Function: 2 * Sqrt('TagVoltage') multiplies 2 by the square root of TagVoltage.
Examples
Mathematical Operation | Expression | Description |
---|---|---|
Addition | 'TagPressure' + 'TagTemperature' | Adds the values of TagPressure and TagTemperature |
Subtraction | 100 - 'TagFlowRate' | Subtracts the value of TagFlowRate from |
Multiplication with Function | 2 * Sqrt('TagVoltage') | Multiplies 2 by the square root of TagVoltage |
Complex Expressions
You can create more complex expressions by combining multiple operations and using parentheses ()
to control the order of evaluation.
Examples
Expression | Description |
---|---|
('TagLevel' * 'TagDensity') / (10 + 'TagViscosity') | multiplies TagLevel and TagDensity, then divides by the sum of 10 and TagViscosity |
Sin('TagAngle') * 'TagForce' | multiplies the sine of TagAngle by TagForce. |
Asset-Based Calculations
Asset-based calculations allow you to use data in a structured, hierarchical context.
- Attribute Dragging: Drag AF attributes into the Expression field to incorporate them into expressions.
- Asset Context: When you drag an asset into the editor, it sets the asset context, meaning calculations will automatically reference attributes relative to that asset.
Attribute Paths
- Single Database: All attributes in a calculation must be from the same AF database.
- Relative Paths: Attributes at or below the asset context level can use relative paths, simplifying expressions.
- Absolute Paths: Attributes from higher levels or separate branches need their full paths relative to the AF database root.
Examples of Asset-Based Expressions
Same Element Attributes
If the asset context is set to Pump1 and both Speed and Torque are attributes of Pump1, the expression looks like:
('Speed' * 'Torque') / 5252
This calculates the horsepower of the pump.
Different Element Attributes
If you need to reference an attribute from a different element, such as Pressure from Pump2, the expression includes the full path:
('Speed' + '\PlantArea\Pump2|Pressure') * 0.1
This expression adjusts the speed by adding a fraction of the pressure from another pump.
Note: For calculations across different data sources or AF databases, use the Python driver.
5. Configure the Calculation
After defining your expression, you can configure several options to tailor the calculation to your needs:

Calculation Interval & Interval Sync Time
The Calculation Interval
defines the specific time span over which calculations are performed. The Interval Sync Time
specifies the time of day (in 24-hour format) from which calculation intervals begin. This aligns the intervals to a specific start time, such as midnight or the top of the hour.
Example
- Calculation Interval: 30 minutes
- Interval Sync Time: 00:00:00 (midnight)
In this scenario calculations are performed every 30 minutes, starting from midnight.
The calculated values are plotted at the start of each interval.
New values appear at timestamps like:
00:00:00
00:30:00
01:00:00
01:30:00
02:00:00
And so on throughout the day.
This configuration ensures that your data aligns neatly with regular time intervals, which is important for consistent reporting and analysis.
Calculation Basis
The Calculation Basis
defines how data is weighted over the calculation interval, specifying how to handle data when calculating summary statistics:
Time-Weighted: Data points are weighted based on the time they represent, useful for continuous processes with unevenly spaced data points.
Event-Weighted: Each data point is weighted equally, regardless of the time interval, suitable for discrete events where each point holds equal significance.
Sample Type
The Sample Type
specifies the data retrieval method for evaluating expressions:
ExpressionRecordedValues: Uses actual recorded values at each timestamp when any operand has new data, ideal for working with raw, collected data.
Interval: Samples data at regular intervals set by the
Sample Interval
, providing consistent sampling over time.
Sample Interval
The Sample Interval
sets the time between samples (e.g., every 5 minutes), defining the frequency of data evaluation.
Time Type
The Time Type
determines which timestamp is used for each data point in calculations:
- Auto: Automatically selects the most suitable time type.
- EarliestTime: Uses the first timestamp in each interval, helpful when referencing the start of an interval.
- MostRecentTime: Uses the latest timestamp in the interval, ideal when the latest data is most relevant.
Unit of Measure (UOM)
Defines the unit for calculated values, ensuring data consistency (e.g., psi, °C, L/s).
Total Conversion Factor
Applies a conversion factor for totals, useful for unit adjustments in total calculations.
This only applies to the Total
summary column.
Data Type
Specifies the result’s data type, including:
- Double: Floating-point number
- String: Text
- Int32: 32-bit integer
Other Configuration Options

- Refresh Interval: Defines how frequently the calculation updates with new data, which should align with the update rate of your underlying data.
- Stepped Plot: Controls whether the data is displayed as a stepped plot, ideal for discrete values that change at specific intervals.
6. Preview the Calculation
The Preview window displays sample results with timestamps, including statistics like Average, Minimum, Maximum, Percent Good (PctGood), and Standard Deviation.
7. Apply and Manage the Calculation
- Click
Apply
to save the calculation. - The saved calculation will appear in the
Calculation
tab. To display results, drag and drop the calculation onto a component, such as a Line Chart. - To edit a calculation, select it and click the edit (pencil) icon.
- To delete a calculation, select it and click the delete (trash) icon.
Note
Calculations are specific to the display where they were created. To use calculations across different displays, consider using the Python driver.
Summary
- PI System Calculations allow for on-the-fly data transformation using PI points or attributes.
- Ensure all data used in a calculation comes from the same Data Archive or AF database.
- Expressions are built using standard arithmetic operators and functions.
- Calculation Options like Calculation Interval, Calculation Basis, Sample Type, and Time Type help tailor the calculations to your needs.
- Use the Preview to verify results before applying.
- Manage your calculations easily within the Calculation tab.