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

PI DataLink

PIAdvCalcDat()

  • Last UpdatedNov 21, 2022
  • 2 minute read

Returns evenly spaced values calculated from PI point or PI AF attribute values during a specified time period.

Syntax

PIAdvCalcDat(DataItem, STime, ETime, Interval, Mode, CalcBasis, MinPctGood, CFactor, OutCode, RootPath)

Arguments

Argument

Type

Description

DataItem

String

The PI point name or PI AF attribute name for which the function calculates values. Specify a range of cells that contain PI point names or PI AF attribute names to calculate 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.

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

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. See Data items.

Example

=PIAdvCalcDat("sinusoid","y","t","3h","total","time-weighted",50, 1,4,"")

Returns the time-weighted total for the PI point sinusoid calculated from the values on the default Data Archive server for three-hour intervals from midnight yesterday to midnight today.

The function multiplies the result by 1, and only returns a result if at least 50 percent of the data is good. The function returns the percent good to the right of each calculated total.

See also

Calculated Data function

Define functions manually

Guidelines for entering arguments manually

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