Skip to content
Software AthleteSoftware Athlete
PI Vision Calculation Syntax: Practical Examples and Troubleshooting

PI Vision Calculation Syntax: Practical Examples and Troubleshooting

PI Vision calculations let you create display-level expressions without changing the underlying PI System data model. This guide explains the syntax, shows practical Performance Equation examples, and helps you decide when a calculation belongs in PI Vision—or should become a managed AF Analysis instead.

Updated August 24, 2026 Originally published July 17, 2023 By Software Athlete PI System engineering team

In AVEVA PI Vision, a calculation can combine PI points or AF attributes, arithmetic operators, logical conditions, time expressions, and Performance Equation functions. The result can then be used as a data item in a value, trend, table, gauge, or another compatible symbol on that display.

The foundation

PI Vision calculation syntax at a glance

PI Vision uses familiar Performance Equation syntax. Most formulas become easier to understand when you separate them into four parts: data references, operators, functions, and time expressions.

01

Quote data references

Enclose PI point names and inserted data references in straight single quotes, such as 'SINUSOID'.

02

Control evaluation order

Use parentheses around the part that should be calculated first: ('TagA' + 'TagB') / 2.

03

Pass function arguments correctly

Functions use parentheses and comma-separated arguments, for example TagVal('TagA','*-2h').

04

Keep output types consistent

A conditional expression is easier to use when all branches return compatible numeric, text, or digital-state results.

Arithmetic'SINUSOID' * 2
Grouped arithmetic('CDT158' + 'SINUSOID') / 2
FunctionLog('CDT158')
Conditional logicIF 'Flow' > 100 THEN 1 ELSE 0

Copy/paste warning: use straight quotes ('), not typographic smart quotes (‘ ’). A formula can look correct in a document or email and still fail to parse after smart-quote substitution.

Step by step

How to create a calculation in PI Vision

1

Open the Calculations pane

Open or edit a PI Vision display, then select Calculations in the left navigation pane. Existing calculations for the current display appear here.

2

Add a calculation and choose its data basis

Create a new calculation. Depending on your PI Vision version and configuration, base it on PI points from a PI Data Archive or on assets and attributes from PI AF.

3

Build the expression

Insert or drag the required data references into the editor, then add operators, parentheses, functions, time arguments, and any IF/THEN/ELSE logic.

4

Preview the result

Use the preview before saving. Check both the returned value and whether the result behaves correctly across the intended display time range.

5

Review advanced options

Configure available options such as the time interval, total conversion factor, or stepped plotting based on the meaning of the result—not only how the trend looks.

6

Save and visualize it

Give the calculation a clear display-specific name, save it, and use it as the data source for the appropriate PI Vision symbol.

Reusable patterns

Practical PI Vision calculation examples

These examples illustrate common syntax patterns. Replace the example point names with data references from your environment and validate the result against known values before relying on it operationally.

Scale a value

Multiply a PI point by a constant

'SINUSOID' * 2

Useful for a display-only conversion or scaling factor. If the converted value is an enterprise definition used across displays, model it centrally instead.

Combine values

Average two current point values

('CDT158' + 'SINUSOID') / 2

Parentheses make the intended evaluation order explicit before the sum is divided.

Summary function

Calculate a one-hour average

TagAvg('SINUSOID','*-1h','*')

The time range begins one hour before the current evaluation time and ends at the current evaluation time.

Historical lookup

Retrieve a value from two hours earlier

TagVal('TagName','*-2h')

Use an explicit relative time argument when the calculation needs a historical value rather than the current value.

Conditional logic

Return a simple operating-state flag

IF 'Flow' > 100 THEN 1 ELSE 0

This can drive a display indicator. For a governed state definition used elsewhere, an AF Analysis is usually easier to maintain.

Data quality

Handle a bad input value

IF BadVal('Flow') THEN 0 ELSE 'Flow'

Choose the fallback carefully. Returning zero can be misleading if zero is a valid process value; a more explicit state may be safer for your use case.

AVEVA PI Vision calculation editor with Performance Equation function examples
Start with the smallest expression that answers the display question, preview it, and add complexity only when required.

Time-aware expressions

Common PI time expressions in calculations

Time arguments are strings, so place them inside straight single quotes. The right expression depends on whether you need the current evaluation time, a relative offset, or a calendar boundary.

Expression Meaning Example use
'*' Current evaluation time End time for a rolling summary
'*-1h' One hour before the current evaluation time Start time for a rolling one-hour average
'*-2h' Two hours before the current evaluation time Historical comparison or lookup
't' Start of today Daily period boundary
'y' Start of yesterday Previous-day period boundary

Validate calendar logic: rolling durations and calendar periods answer different questions. A rolling 24-hour calculation is not always equivalent to “today,” especially around shift boundaries or daylight-saving changes.

Maintainability

When to use a PI Vision calculation—and when not to

A calculation can be technically valid and still belong in the wrong layer. Decide based on ownership, reuse, persistence, and operational impact.

Good fit for PI Vision
  • The result is specific to one display or investigation.
  • An engineer needs a quick, transparent derived value.
  • The value does not need to be written back to the PI Data Archive.
  • The display owner can validate and maintain the expression.
Consider AF Analytics
  • The same definition must be reused across many displays or applications.
  • The result must be scheduled, persisted, backfilled, or written to an output point.
  • The logic is business-critical, complex, or subject to formal change control.
  • Central ownership, monitoring, and calculation history are required.
Average calculation configured in the AVEVA PI Vision calculation editor
A clear name, small expression, and documented purpose make display calculations easier for the next engineer to understand.

Parsing and result checks

Why a PI Vision calculation may not work

Performance Equation parsing error

Check quote characters, parentheses, commas, function names, and argument counts. Re-type copied quotes directly in the editor.

No good data for calculation

Inspect every input over the requested time range. A bad value, missing archive data, or incompatible output branch may prevent evaluation.

Unexpected result order

Add parentheses even when operator precedence seems obvious. Explicit grouping is easier to review and safer to maintain.

Correct preview, confusing trend

Review the calculation interval, time range, stepped-plot choice, and total conversion factor. Presentation settings can change how a valid result appears.

Expression is becoming difficult to read

Reduce the formula to smaller testable parts. If the logic remains complex or reusable, move the definition to AF Analytics.

Current value differs from a historical summary

Confirm whether the function uses interpolated, recorded, sampled, or calculated data and whether its start and end times match the intended period.

Frequently asked questions

PI Vision calculation FAQ

Do PI Vision calculations write values to the PI Data Archive?

No. A display calculation derives a result for use in PI Vision; it does not create stored archive values. Use a managed analysis with an appropriate output when persistence is required.

Can I use both PI points and AF attributes?

PI Vision supports calculations based on PI Data Archive points and asset-based data from PI AF. The exact editor options depend on the installed PI Vision version and configuration.

Why do quotes matter in PI Vision calculation syntax?

Data references and time strings use straight single quotes. Smart quotes introduced by word processors, websites, or email can cause a parsing error even when the expression looks visually correct.

Can the same calculation be used on several displays?

You can recreate a similar expression, but display calculations are not the best source of truth for a shared enterprise definition. Put reusable governed logic in AF Analytics and reference the result from PI Vision.

Where can I find all supported calculation functions?

Use our PI Vision calculation functions reference for the full function-oriented companion to this syntax tutorial.

From formulas to operational dashboards

Use calculations inside richer PI Vision workflows

Vision Library+ adds configurable symbols for analysis, visualization, navigation, Event Frames, and data entry. Many controls can work with calculated data while keeping the dashboard experience inside PI Vision.

5 comments on PI Vision Calculation Syntax: Practical Examples and Troubleshooting
  • Christof
    Christof

    Hi Dean,
    you cannot leave comments on an equation, but you can add a description to it. But you can add comments using the manual input plus symbol.

    May 28, 2024
  • Dean Bartley
    Dean Bartley

    Is there a way to leave comments on an equation to clarify what is happening?

    May 21, 2024
  • Juan Manuel Zita
    Juan Manuel Zita

    Hello, I have the same question as Yoshi Katsu.
    thank you

    March 20, 2024
  • Christof
    Christof

    Hi Yoshi, unfortunately that is not possible, you can only refer to existing attributes or tags.

    November 01, 2023
  • Yoshi Katsu
    Yoshi Katsu

    Thank you for your nice information.
    I have one question. Can I refer the equation made in calculation editor to new equation in calculation editor?
    for example,
    making equation “Sinusoid Average”
    and making" “Sinusoid Average”/ tag1".

    September 23, 2023
Leave a comment

Your email address will not be published..

Cart 0

Your cart is currently empty.

Start Shopping