AnsweredAssumed Answered

Looking for ways to speed up AFAttribute.Step calls

Question asked by Mark.Derbecker on Aug 24, 2016
Latest reply on Aug 24, 2016 by rdavin

I have code that iterates through all AFElements in an AFDatabase, then iterates through all AFAttributes and uses their Step flag. The call to Step is very slow, it appears to be doing a round-trip to the PI server and connecting/disconnecting to said server every time.


My current sequence of calls is this:


AFDatabase.FindElements() to get all the elements in the database

AFElement.LoadElements() to load them all in one shot

Loop through all elements

  Loop through all attributes for a given element

    Call AFAttribute.Step


In a different piece of code, when I iterate through PI tags directly (no AF involved), I have the nifty FindPIPoints() API that takes in a list of PIPointAttributes and reduces the round-trips. But I don't see anything that accomplishes something similar for AF.