AnsweredAssumed Answered

Array of values from PIASK

Question asked by benny on Aug 17, 2017
Latest reply on Aug 18, 2017 by benny

Since years I'm using VB.NET make graphs and tables from vaules in PI. So far I have always used PIOLEDB to connect to PI and fetch the values. Using a SQL something like:

SELECT value from piarchive..piavg WHERE tag= 'Test-Value' AND time BETWEEN '01-12-2011' AND '01-01-2012' AND timestep= '1m' AND calcbasis='TimeWeighted'

I'm now wondering if I can upgrade my code to use AFSDK. Maybe i'ts faster or at least more modern. :-) Reading the documentation I'm a bit confused. I have tried several snippets but none are giving me the desired effect. Basically I want a function giving me a array (or list or something) with the values over a given timeframe averaged in the fragments I want. Like two days of data,1 minute averages giving 1440 X 2 = 2880 values. The closed I came is interpolated values but this is just not good enough. Can someone point me in the correct direction or does someone has a code sample? I looked read hard on the net but found nothing.

Outcomes