jimmilton

Values from time span with frequency

Discussion created by jimmilton on Feb 7, 2011
Latest reply on Feb 9, 2011 by andreas

I have been searching for how to accomplish the following.   I'm creating a service that will take in a server name, point, start time, end time, and an interval in seconds.  The goal is to allow the a client application to submit a request for data for example from a server for tag "Sinusoid" for 1/1/2011 3:00:00 to  1/1/2011 22:30:00 with an interval of 300 (5 minutes) and get back a dataset of timestamps and values every 5 minutes through the period (228 values returned).  I have been trying to figure out how to do this with PI SDK.  Could anyone give me an example of how this is written?  I have the code to connect to the server and pick the point, but getting the recorded values in the manner I gave the example for is what is throwing me.  

 

As a side question to the example above, if I get back a value for a period like stated above, would I get back averaged values, sampled values, or something else?  What I mean is, if the data collection rate is around 4 seconds, we will have lots of values in a 5 minute period, so will the returned value for the 5 minute period be a sample of the 4 second values, and average of the 4 second values, or something else?  Can I tell PI if I want average vs sample vs other?

 

Thanks for the help.

 

 

 

UPDATE:  I'm doing this in C#

Outcomes