AVEVA PI Vision provides powerful visualization capabilities, but what if you need dynamic, on-demand calculations based on a selected time range? With PI Asset Framework (AF) and Vision Library+, you can achieve this by setting up an interactive display that allows users to trigger calculations as needed.
1. Create a New AF Element
Start by creating a new AF Element to handle the calculation. This element should include attributes for:
- StartTime – Defines the beginning of the calculation period
- EndTime – Defines the end of the calculation period
- Trigger – A manual trigger attribute
- Input Values – The data points used in the calculation
- Output Values – The calculated result

2. Create the AF Analysis
Now, set up an AF Analysis that processes the required calculation. Use the StartTime and EndTime attributes to dynamically adjust the time range of the analysis based on user selection.

3. Configure the Trigger
Set the analysis to Event-Triggered mode. The analysis should execute when:
- The StartTime or EndTime attribute changes
- The Trigger attribute changes (allowing users to manually trigger the calculation)

4. Build a PI Vision Display
Next, create a PI Vision display that allows users to interact with the calculation:
- Use the QuickInput+ control from Vision Library+ to create input fields for StartTime, EndTime, and the Trigger attribute.
- Add a Value Symbol to display the Output Value from the calculation.

5. Test the Dynamic Calculation
Now, test your setup:
- Change the StartTime and EndTime in the QuickInput+ fields.
- Click the Trigger button.
- Observe the Output Value updating as the analysis runs.

With this approach, you can enable interactive, time-based calculations in PI Vision, enhancing your ability to analyze process data dynamically. 🚀