Direkt zum Inhalt
Software AthleteSoftware Athlete
PI Vision Calculations: List of all available functions

PI Vision Calculations: List of all available functions

Ever wanted to know which functions are available for PI Vision calculations and how to use them exactly? Don't worry, here is a list of all Functions available for Calculations in PI Vision 2021 and above:

 

Function Description Example Usage
Eval Evaluates an expression and returns the result Eval('2+2')
EventData Retrieves the value of an event attribute EventData('tag1', 'attr1')
Exp Calculates the exponential value of a number Exp(2)
False Represents a boolean false value False
FindEq Finds the first occurrence of a specified value within a range FindEq('tag1', '-1d', '*', 50)
FindGE Finds the first occurrence of a value greater than or equal to a specified value within a range FindGE('tag1', '-1d', '*', 50)
FindGT Finds the first occurrence of a value greater than a specified value within a range FindGT('tag1', '-1d', '*', 50)
FindLE Finds the first occurrence of a value less than or equal to a specified value within a range FindLE('tag1', '-1d', '*', 50)
FindLT Finds the first occurrence of a value less than a specified value within a range FindLT('tag1', '-1d', '*', 50)
FindNE Finds the first occurrence of a value not equal to a specified value within a range FindNE('tag1', '-1d', '*', 50)
First Retrieves the first value of a specified attribute within a range First('tag1', '-1d', '*')
Format Formats a value according to a specified format string Format('tag1', 'yyyy-MM-dd HH:mm:ss')
GT Compares two values and returns true if the first value is greater than the second value GT(10, 5)
GE Compares two values and returns true if the first value is greater than or equal to the second value GE(10, 5)
Hour Extracts the hour component from a time expression Hour('t')
If Returns one value if a condition is true, and another value if the condition is false If(GT('tag1', 10), 'High', 'Low')
IfPrev Returns one value if the current value meets a condition and the previous value meets another condition IfPrev('tag1', GT('tag1', 10), 'High', 'Low')
IfValue Returns one value if the current value matches a specified value, and another value if it does not IfValue('tag1', 10, 'Equal', 'Not equal')
Interp Interpolates a value based on a specified time Interp('tag1', 't')
IsGood Checks if a value is considered good IsGood('tag1')
Last Retrieves the last value of a specified attribute within a range Last('tag1', '-1d', '*')
Left Extracts a specified number of characters from the left side of a string Left('string', 3)
LE Compares two values and returns true if the first value is less than or equal to the second value LE(5, 10)
LT Compares two values and returns true if the first value is less than the second value LT(5, 10)
Ln Calculates the natural logarithm of a number Ln(10)
Max Returns the maximum value from a list of arguments Max('tag1', 'tag2', 'tag3')
Min Returns the minimum value from a list of arguments Min('tag1', 'tag2', 'tag3')
Minute Extracts the minute component from a time expression Minute('t')
Month Extracts the month component from a time expression Month('t')
NE Compares two values and returns true if the first value is not equal to the second value NE('tag1', 10)
NextEvent Returns the next event after a specified time NextEvent('tag1', 't')
NextVal Returns the next value after a specified time NextVal('tag1', 't')
Or Performs a logical OR operation on two boolean values Or(True, False)
PI Represents the mathematical constant pi PI()
Pos Finds the position of a substring within a string Pos('substring', 'string')
PrevEvent Returns the previous event before a specified time PrevEvent('tag1', 't')
PrevVal Returns the previous value before a specified time PrevVal('tag1', 't')
Radians Converts an angle from degrees to radians Radians(180)
Radix Converts a decimal number to a string in the specified radix Radix(10, 16)
Round Rounds a number to the nearest integer or to a specified number of decimal places Round('tag1', 2)
Second Extracts the second component from a time expression Second('t')
Sign Returns the sign of a number (1 for positive, -1 for negative, and 0 for zero) Sign('tag1')
Sin Calculates the sine of an angle in radians Sin(0)
Sqrt Calculates the square root of a number Sqrt(16)
Step Returns the step attribute of a tag Step('tag1')
Substring Retrieves a substring from a specified string Substring('string', 1, 3)
Sum Returns the sum of a list of values Sum('tag1', 'tag2', 'tag3')
TagAvg Calculates the average of a tag over a specified time range TagAvg('tag1', '-1h', '*')
TagCount Counts the number of good values for a tag within a specified time range TagCount('tag1', '-1h', '*')
TagMax Retrieves the maximum value of a tag within a specified time range TagMax('tag1', '-1h', '*')
TagMin Retrieves the minimum value of a tag within a specified time range TagMin('tag1', '-1h', '*')
TagSpan Retrieves the span (difference between maximum and minimum) value of a tag within a specified time range TagSpan('tag1')
TagSource Retrieves the point source string of a tag TagSource('tag1')
TagTot Calculates the totalized value (time integral) of a tag over a specified time range TagTot('tag1', 'y', '*', 85)
TagType Retrieves the type character (I, R, or D) of a tag TagType('tag1')
TagTypVal Retrieves the typical value of a tag TagTypVal('tag1')
TagVal Retrieves the archived value of a tag at a given time TagVal('tag1', '23-aug-2012 15:00:00')
TagZero Retrieves the zero value of a tag TagZero('tag1')
Tan Calculates the tangent of an angle in radians Tan(1)
Tanh Calculates the hyperbolic tangent of a number Tanh(1)
Text Concatenates strings representing argument values Text(Round('sinusoid', 1), " is the current value of 'sinusoid' at ", '*')
TimeEQ Calculates the total time in seconds within a range when a tag is equal to a given value TimeEQ('tag1', 't', '*', 40.0)
TimeGE Calculates the total time in seconds within a range when a tag is greater than or equal to a given value TimeGE('tag1', 't', '*', 40.0)
TimeGT Calculates the total time in seconds within a range when a tag is greater than a given value TimeGT('tag1', 't', '*', 40.0)
TimeLE Calculates the total time in seconds within a range when a tag is less than or equal to a given value TimeLE('tag1', 't', '*', 40.0)
TimeLT Calculates the total time in seconds within a range when a tag is less than a given value TimeLT('tag1', 't', '*', 40.0)
TimeNE Calculates the total time in seconds within a range when a tag is not equal to a given value TimeNE('tag1', 't', '*', 40.0)
Total Returns the sum of two or more values Total('tag1', 'tag2', TagVal('tag1', 'y'))
Trim Trims blanks on both sides of a string Trim(" String ")
Trunc Truncates a number or time to the next lower unit Trunc(28.75, 10)
UCase Converts a string to uppercase UCase("String")
Weekday Extracts the day of the week from a time expression Weekday('*')
Year Extracts the year from a time expression Year('*')
Yearday Extracts the day of the year from a time expression Yearday('*')
Note: Some functions may have additional optional arguments or variations in usage. Refer to the documentation for detailed information on each function.

 

For more information visit the official AVEVA Documentation: https://docs.aveva.com/bundle/pi-server-da-smt/page/1021628.html

4 Kommentare zu PI Vision Calculations: List of all available functions
  • fadzli
    fadzli

    yes “if…then…else” still does work

    March 19, 2024
  • Youssef Elgharbawi
    Youssef Elgharbawi

    You can use IF in this form
    IF ‘tag’ <X then (Y) else (Z)

    November 29, 2023
  • Lorenzo Hernandez Jr
    Lorenzo Hernandez Jr

    Hamish, IF should still be supported. I use it all the time in my PI Vision Calculations.

    November 25, 2023
  • Hamish Ritchie
    Hamish Ritchie

    Are you sure IF is still supported? I haven not managed to get it to work at all, and it does not appear in AVEVA’s list of supported syntax

    November 14, 2023
Hinterlasse einen Kommentar

Deine Email-Adresse wird nicht veröffentlicht..

Warenkorb 0

Dein Warenkorb ist leer

Beginn mit dem Einkauf