snepes

Get all historical values in a TimeRange from a tag list

Discussion created by snepes on May 29, 2013
Latest reply on Jun 5, 2013 by mhamel

Hi,

 

I need to get all historical values in a TimeRange from a tag list. The sample code below works fine but I think that it isn't the most performatic way to do this. Is there any bulk method? I’m using AFSDK RDA.

 
IList<String> tagList = { "\\\\myPIserver\\sinusoid1", "\\\\myPIserver\\sinusoid2", "\\\\myPIserver\\sinusoid3" };
IDictionary<String, AFValues> allValues = new Dictionary<String, AFValues>();
foreach(String tag in tagList)
{
                AFAttribute atrib = AFAttribute.FindAttribute(tag , null);
                AFValues valores = atrib.Data.RecordedValues(new AFTimeRange(startTime, endTime), AFBoundaryType.Outside, null,
                    null, true, 0);
               allValues.Add(tag, valores); 
}

 

 

 Thanks!

 

Ludmila

 

 

Outcomes