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

PI DataLink

PIAdvCalcExpFilDat()

  • Last UpdatedNov 21, 2022
  • 2 minute read

Returns evenly spaced values calculated from a filtered performance equation during a specified time period.

Syntax

PIAdvCalcExpFilDat(Expression, STime, ETime, Interval, FiltExp, Mode, CalcBasis, SampMode, SampFreq, MinPctGood, CFactor, OutCode, RootPath)

Arguments

Argument

Type

Description

Expression

String

One or more performance equations that the function computes a value for. See Expressions.

To specify multiple expressions, enter a range of cells that contain complete expressions. The function returns values for each.

STime

String

The start of the time period for which the function calculates values. See Time inputs.

ETime

String

The end of the time period for which the function calculates values. See Time inputs.

Interval

String

The interval between returned values. Enter a value and time unit that specifies the length of the interval. For example, enter 15m (15 minutes) to return a value for every 15-minute interval during the time period. See Learn about time-interval specifications.

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:

  • total

  • minimum

  • maximum

  • stdev

  • range

  • count

  • average (time-weighted)

  • average (event-weighted)

CalcBasis

String

The calculation method:

  • time-weighted

  • event-weighted

SampMode

String

The sampling method the function uses to determine when to evaluate Expression and FiltExp:

  • compressed

  • interpolated

SampFreq

String

The frequency that the function evaluates Expression and 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, 7, 8, and 9 (if Mode is set to minimum, maximum, or range).

RootPath

String

The path to the data item referenced by the expression. See Data items.

Example

=PIAdvCalcExpFilDat("'sinusoid'+'cdt158'","y","t","3h","'cdm158'=""Manual""","total","time-weighted","compressed","10m",50,1,4,"")

Calculates a time-weighted total for the expression 'sinusoid'+'cdt158' when 'cdm158' = "Manual" at three-hour intervals from yesterday to today from the default Data Archive server.

The function multiplies each calculated total by 1 and returns a value when the percent of good values is at least 50 percent during the three-hour interval. The function returns the percent good to the right of the calculated total. Note that because the sampling mode is compressed, the function ignores the sampling frequency, and samples values whenever sinusoid or cdt158 has a recorded value or the value of cdm158 changes to or from Manual.

See also

Calculated Data function

Filter expressions

Define functions manually

Guidelines for entering arguments manually

Interpolated values

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