PIAdvCalcFilVal()
- Last UpdatedNov 21, 2022
- 2 minute read
- PI System
- PI DataLink 2023 SP1
- Visualization
Returns a value calculated from filtered PI point or PI AF attribute values during a specified time period.
Syntax
PIAdvCalcFilVal(DataItem, STime, ETime, FiltExp, Mode, CalcBasis, SampMode, SampFreq, MinPctGood, CFactor, OutCode, RootPath)
Arguments
|
Argument |
Type |
Description |
|---|---|---|
|
DataItem |
String |
The PI point name or PI AF attribute name for which the function calculates a value. Specify a range of cells that contain PI point names or PI AF attribute names to calculate a value for each. |
|
STime |
String |
The start of the time period for which the function calculates a value. See Time inputs. |
|
ETime |
String |
The end of the time period for which the function calculates a value. See Time inputs. |
|
FiltExp |
String |
A Boolean performance equation that the function uses to filter values. When the expression evaluates to false, the function excludes corresponding values. See Filter expressions. |
|
Mode |
String |
The type of calculation that the function performs:
|
|
CalcBasis |
String |
The calculation method:
|
|
SampMode |
String |
The sampling method the function uses to determine when to evaluate FiltExp:
|
|
SampFreq |
String |
The frequency that the function evaluates FiltExp if SampMode is set to interpolated. Enter a value and time unit. For example, set to 10m (10 minutes) to return an interpolated value for every 10-minute interval. See Learn about time-interval specifications. |
|
MinPctGood |
Number |
The minimum percentage of good data required during the time period to calculate and return a value. |
|
CFactor |
Number |
A factor that the function applies to the returned value. Enter 1 if a conversion factor is not needed. For time-weighted total calculations, specify a factor that converts recorded rate values to the server default time unit (units per day). |
|
OutCode |
Integer |
An output code that determines what appended data the function returns and how the function orients output. See Output codes for information on how to compute the code. This function supports bits 2, 3, and 9 (if Mode is set to minimum, maximum, or range). |
|
RootPath |
String |
The path to the data item. See Data items. |
Example
=PIAdvCalcFilVal("sinusoid","y","t","'cdm158'=""Manual""","total","time-weighted","compressed","10m",50,1,4,"")
Returns the time-weighted total for the PI point sinusoid calculated from the values on the default Data Archive server, summing values from yesterday to today during the time periods when the PI point cdm158 is set to Manual.
The function multiplies the result by 1. Because the sampling mode is compressed, the function ignores the sampling frequency and samples the filter expression at the compressed events of the point sinusoid. The function only returns a result if at least 50 percent of the data is good. The function returns the percent good to the right of the calculated total.