<< Clique para Mostrar o Sumário >>
EpmLastChangeRecordedFunction |
Returns data from the last change found from the variable informed in the @node parameter.
SELECT Name, Timestamp, Quality, Value FROM EpmLastChangeRecordedFunction(@timeZoneOffset, @timestamp, @monitorValue, @monitorQuality, @monitorTimestamp, @bringBothPoints, @node)
•@timeZoneOffset: Timezone to consider. Possible values range between -12 and 14
•@timestamp: Time to consider for retrieving data. Users must use a String in the format yyyy-MM-dd HH:mm:ss
•@monitorValue: Indicates whether the variable value must be considered as a change. Possible values are 1 (one, True) or 0 (zero, False)
•@monitorQuality: Indicates whether variable value's quality must be considered as a change. Possible values are 1 (one, True) or 0 (zero, False)
•@monitorTimestamp: Indicates whether the record's timestamp must be considered as a change. Possible values are 1 (one, True) or 0 (zero, False)
•@bringBothPoints: Indicates whether the result must have both the change recording and the result's previous record. Possible values are 1 (one, True) or 0 (zero, False)
•@node: Variable or variables to query. Users must inform the full name or names between single quotes and comma-separated
•Name: Name of the variable or variables queried
•Timestamp: Timestamp of data found
•Quality: Quality of data found
•Value: Value of data found. Possible returned data types are intval (integer), doubleval (floating point), charval (String), to_date (date and time), or opc_str (OPC UA quality String)
To return the record of the last change of variable RandomTags_Random1 at 10:23 on 12/07/2020, with a timezone of -3 (minus three) hours and considering quality and timestamp as a change of value, but without adding the previous record, use the next declaration.
SELECT Name, Timestamp, Quality, Value FROM EpmLastChangeRecordedFunction(-3, '2020-12-07 10:23:00', 1, 1, 1, 0, 'RandomTags_Random1')