Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI System Management Tools

Performance equation arguments

  • Last UpdatedOct 04, 2024
  • 2 minute read

Performance equation functions have one or more arguments, or inputs, which are enclosed in parentheses following the function name. Some of the arguments may be optional. If there are several arguments, they are separated by commas:

functionName(argument1, argument2, argument3)

The following are examples of function expressions:

Max(3, 5, 12.6, 'sinusoid')

The Max function returns the maximum from a set of values. See Max (Tag-based PE function).

PrevEvent('sy:arc001', '*-2h')

The PrevEvent function returns the timestamp of the previous Archive event for tagname before time. PrevEvent (Tag-based PE function).

Sqr(Abs(TagMax('tag', 'y', 't')))

The Sqr function returns the square root of x. See Sqr.

The Abs function returns the square root of x. See Abs (Tag-based PE function).

The TagMax value returns the point's maximum value during a given time. See TagMax (Tag-based PE function).

Log(if 'tag'=2 then .5 else .2)

The Log topic returns the natural logarithm of x. See Log.

Functions can also be nested and joined in expressions, as shown here with the Avg, TagVal, and Sin functions. See Avg (Tag-based PE function), TagVal (Tag-based PE function), and Sin.

Avg(TagVal('TagA', 'y'), TagVal('TagB', 'y'), TagVal('TagC', 'y') )

if TagVal('TagA', '*') < TagVal('TagB', '*') then sin('TagB') else
sin('TagA')

You can use a tagname in any argument where a number or character string is called for. A tagname in single quotes is evaluated as if it had been written TagVal(tagname), which is the same as TagVal('tagname', '*' ). This gets the point's value at the "current" time for the calculation.

If the argument calls for a number, but the point's value is a digital state when the function is evaluated, a run-time error (Calc Failed) is generated.

Note: The pipetest utility can be used to check the syntax of a performance equations. See Run the pipetest utility.

TitleResults for “How to create a CRG?”Also Available in