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

Analytics and Notifications for PI System Explorer (PI Server 2018)

RecordedValues

  • Last UpdatedJan 11, 2023
  • 2 minute read

Obtain values within a particular time range based on user-specified boundary type.

Syntax

RecordedValues(attname, starttime, endtime [, boundarytype])

Arguments

  • attname

    attribute of time series data (such as PI point data reference) enclosed in single quotes

  • starttime

    a time expression representing the beginning of a time range enclosed in single quotes; can be a relative time (such as '-3h') in reference to an absolute endtime

  • endtime

    a time expression representing the end of a time range enclosed in single quotes; can be a relative time (such as '+1h') in reference to an absolute starttime

  • boundarytype

    a string indicating the data retrieval behavior at the end points of a specified time in double quotes:

    "Inside" - return the nearest recorded values inside the requested time range as the first and last values

    "Outside" - return the nearest recorded values on the outside of the requested time range as the first and last values

    "Interpolated" - create an interpolated value at the end points of the requested time range if a recorded value does not exist at that time

    Note: If unspecified, the default is the "Inside" mode.

Returns

An array of the values obtained within the specified range

Exceptions

If the attribute does not support range calls, the function returns an error with indication

Notes

  • If the starttime is earlier than the endtime, the resulting values will be in time-ascending order, otherwise they will be in time-descending order.

  • When no values are available but you specified "Outside" or "Interpolated" boundary types, a special value (NoData) is returned.

  • This function retrieves up to 500,000 values at a time.

Example

  • RecordedValues('att1', 't+2h', 't+8h')

    [Return the values of 'att1' between 2:00 and 8:00am today using the default "Inside" retrieval mode]

  • RecordedValues('att1', 't', '+1h', "Outside")

    [Return the values of 'att1' between 12:00 and 1:00am today using the "Outside" retrieval mode]

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