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 2024 R2)

FindLE

  • Last UpdatedJan 11, 2023
  • 2 minute read

Find the first time within a time interval when an attribute is less than or equal to a specified value.

Syntax

FindLE(attname, starttime, endtime, x)

Arguments

  • attname

    The name of an attribute enclosed in single quotation marks

  • starttime

    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

    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

  • x

    The value to search for; must be an integer or real number or digital state (character string)

Returns

The timestamp closest to starttime within the specified interval when the attribute was less than or equal to the specified value. Returns the corresponding system digital state (No Result, No Data, and the like) if the attribute was always greater than the specified value.

Exceptions

None

Notes

  • If needed, interpolation is done between attribute values to determine when the attribute was equal to the specified value

  • Interpolation occurs when:

    • the underlying PI point has step attribute turned off

    • there is no recorded value with the specified timestamp

  • The interpolated value will be based on the values before and after the timestamp

  • No value will be interpolated if the step attribute is turned on. In this case, the value of record will be that at the time of the event (if it exists) or the previously-recorded value

  • If endtime is earlier than starttime, the time interval is searched backwards

Example

  • FindLE('att1', 't', '*', 40)

    [Return the timestamp of the first time after midnight today when att1 was less than or equal to 40]

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