Lonnie Bowling

Getting Summary Data

Discussion created by Lonnie Bowling Champion on Aug 30, 2010
Latest reply on Aug 30, 2010 by Lonnie Bowling

I want to get the average/min/max for a tag in the last hour (-1h).  This is the code I'm using:

req = new PISummaryDataRequest();
tr.Start = "*";
tr.End = "*-2h";
req.TimeRange = tr;
aggmnr = new PISummaryManner();
aggmnr.Intervals = 1;
aggmnr.UseStart = true;
 
aggmnr.SummaryValue = PISummaryMannerSummaryValue.Minimum;
aggmnr.WeightType = PISummaryMannerWeightType.EventWeighted;
req.PISummaryManner = aggmnr;
req.Path = "pi:\\\\lb-svr01\\CDT158";
requests[1] = req;

The issue is the intervals setting, when set =1 no data points are returned, when set =2 a data point is returned but it is for data from the start time to (endtime-starttime)/2.  With this logic it is impossible to get summary data up to the current time (*) over a specifed period, is this correct?

 

I'm trying to create a simple KPI where I use the web service to return the min/avg/max for a data point for the last hour.  Any help would be appreciated!

 

 

 

Thanks,

 

Lonnie

 

 

Outcomes