EpmLastChangeRecordedFunction

<< Click to Display Table of Contents >>

 

EpmLastChangeRecordedFunction

Returns data from the last change found of the variable informed in the @node parameter.

 

Syntax

SELECT Name, Timestamp, Quality, <type_function>(Value)
  FROM EpmLastChangeRecordedFunction(<[float]@timeZoneOffset>,
  <[datetime]@timestamp>, <[bit]@monitorValue>, <[bit]@monitorQuality>,
  <[bit]@monitorTimestamp>, <[bit]@bringBothPoints>, <[string]@node>)

 

Parameters

<type_function>: Conversion function to define a data type for the resulting values on the Value column. Possible values are described on topic EpmReadPropertyFunction

<[float]@timeZoneOffset>: Timezone to consider. Possible values range from -12 to 14

<[datetime]@timestamp>: Time to consider for retrieving data. It must use a String in the format yyyy-MM-dd HH:mm:ss

<[bit]@monitorValue>: Indicates whether a variable's value must be considered as change. Possible values are 1 (one) or 0 (zero)

<[bit]@monitorQuality>: Indicates whether a variable's value quality must be considered as change. Possible values are 1 (one) or 0 (zero)

<[bit]@monitorTimestamp>: Indicates whether the record's time must be considered as change. Possible values are 1 (one) or 0 (zero)

<[bit]@bringBothPoints>: Indicates whether the result must have both change record and the record previous to the result. Possible values are 1 (one) or 0 (zero)

<[string]@node>: Variable or variables to retrieve. Users must inform a full name or names between single quotes and separated by commas

 

Result Fields

Name: Name of a variable or variables retrieved

Timestamp: Timestamp of data retrieved

Quality: Quality of data retrieved

Value: Value of data retrieved

 

Example

To return the record of the last change of the RandomTags_Random1 variable at 10:23 of 12/07/2020, with a timezone of -3 (minus three) hours and considering as a change the value, the quality, and the timestamp, but without displaying the previous record, use the next statement.

SELECT Name, Timestamp, Quality, doubleval(Value) FROM EpmLastChangeRecordedFunction(-3,
  '2020-12-07 10:23:00', 1, 1, 1, 0, 'RandomTags_Random1')

 

EpmLastChangeRecordedFunction function

EpmLastChangeRecordedFunction function

Was this page useful?