AnsweredAssumed Answered

IPICalculation.Calculate equivalent in AFSDK example ?

Question asked by Chirag89 on Oct 25, 2017
Latest reply on Nov 16, 2017 by rdavin



I am trying to upgrade from PISDK to AFSDK. At some places i can see to calculate the initial, final, avg, min, max values related to a point for a specific time range, IPICalculation.Calculate method is used :


PISDK.IPICalculation objPICalculation;

var objPIAverageValues = objPICalculation.Calculate(startTime, endTime, "tagavg('" + piTag.TagName + "','*+" + intMinutes.ToString() + "m','*')", PISDK.SampleTypeConstants.stRecordedValues, null, null);


objPIInitialValue = objPICalculation.Calculate(startTime, startTime, "tagval('" + piTag.TagName + "','*')", PISDK.SampleTypeConstants.stRecordedValues, null, null);


objPIFinalValue = objPICalculation.Calculate(endTime, endTime, "tagval('" + piTag.TagName + "','*')", PISDK.SampleTypeConstants.stRecordedValues, null, null);




Now this operation is done on individual point. For multiple tags, this operation is done inside a loop. While using AFSDK, i want to use same kind of method on PIPointList instead of individual point for better performance/bulk data retrieval.


Can somebody help me in achieving the same with some syntax ?