DeltaValue
- Last UpdatedApr 11, 2025
- 2 minute read
- PI System
- PI Server 2024 R2
- PI Server
Return the difference between the current and immediately previous values or evaluations of an attribute with a numeric or DateTime value type.
Syntax
DeltaValue(x [, prevEval])
Arguments
-
x
An attribute or expression of a numeric or DateTime value type
-
prevEval
(Boolean) If False or not specified, x must be an attribute, and DeltaValue returns the difference between its current value and immediately previous value.
If True, DeltaValue returns the difference between the current and immediately previous evaluations of x, which can be any expression with a numeric or DateTime value type
Returns
Returns the difference between the current value and the immediately previous value of an attribute with a numeric or DateTime value type, or the difference between the current and immediately previous evaluations for any expression with a numeric or DateTime value type
Notes
When x is of DateTime data type, DeltaValue returns the time interval (in seconds) between two DateTime values. If the time interval value is output to an attribute, make sure the attribute data type is set to double
This function may use input values from PI points. If the compression is on for a PI point, all of its values may not be preserved in PI Data Archive. Before you try to validate the results of this function using a client tool such as PI Datalink, make sure the compression is turned off. This is to ensure that all associated PI point values are included for validation. When validation is complete, be sure to turn the compression back on again as a best practice
Unit of measure of the argument, if it exists, is carried over to the result
Example
-
DeltaValue('att1' [, FALSE])
[Return the difference between the current and immediately preceding value of 'att1']
-
DeltaValue('att1', TRUE)
[Return the difference between the current and last evaluated value of 'att1']