Curve (Tag-based PE function)
- Last UpdatedOct 04, 2024
- 1 minute read
- PI System
- PI Server 2023
- PI Server
Return the y value of a curve given the x value.
Syntax
Curve( x, (x1,y1) (x2,y2) … (xn,yn) )
Arguments
x
Expression evaluating to a number
x1, y1
The first point on the curve. The xi's and yi's are numeric constants evaluated at compile time. The values set for xi's must be in ascending order.
Returns
Returns the y value on the curve corresponding to the value of x. Linear interpolation is used between points defining the curve. If the value of x is less than x1 then y1 is returned and if it is greater than xn, yn is returned. The points are assumed to be ordered in the x direction from smallest to largest.
Exceptions
If the value of x is not an integer or real number, an error value is returned
Example
Curve(3, (0,100) (100,0) )
-
[Returns 97]
Curve('tag1', (25,25) (75,75) )