I need to find the first time a value equals a certain value. Can I do it in Datalink? Additional I also want to find the last time a value equals a certain value.
A number of ways to do this. I would recommend using the DataLink function Archive Value, and then clicking the expression radio button. Henlo de Waal, provided the expression you can enter in the expression box. By switching around the start time and end time you can find the first or last value within the time range. You might want to consult this video to get started: OSIsoft: Get historical PI Data with the PI Archive Value function (PI DL 2013 Excel Add-in) - YouTube..
For that you will be using the following expressions
value is the actual value that you want to find, below is a copy from the "PEReference" help file, you can find it in C:\Program Files\PIPC\HELP
Find the first time, within a range, when a point is equal to a given value.
FindEq(tag, starttime, endtime, value)
A tagname enclosed in single quotes.
Beginning of the time range to search; timestamp or time relative to endtime if endtime is a timestamp.
End of the time range to search, timestamp or time (in seconds) relative to starttime if starttime is a timestamp. If endtime is earlier than starttime, the range is searched backwards.
Must be an integer or real number or digital state (character string), the value to search for.
The timestamp closest to starttime, within the given range, for which the point was equal to the given value.
If the point was never equal to the given value, FindEq returns an error value.
FindEq interpolates between archive events, if necessary, to find the value it is looking for.
FindEq('tag1', 't', '*',40.0) FindEq('digitaltag', '-1d', '*', TagVal('digitaltag', '14-Dec-97')) FindEq('digitaltag', '14-Dec-97', '*', "On")
I am not sure how to use the performance eqations with datalink. Which formula should I use?
Retrieving data ...