Is there is a method to get a list of PIPoints providing a list of point ID’s?
Similar to FindPIPoint(PIServer,Int32) but for a list of PI Points.
Please review this example and let us know if it is what you are looking for:
Dim mySDK As New PISDK.PISDK
Dim mySrv As Server = mySDK.Servers.DefaultServer
Dim myPoints As PISDK.PointList
Dim myPointID As PointAttribute
myPoints = mySrv.GetPoints("tag='s*'", Nothing)
For Each myPoint As PIPoint In myPoints
myPointID = myPoint.PointAttributes("pointid")
Console.WriteLine(myPoint.Name & " has ID: " & myPointID.Value.ToString())
Catch ex As Exception
Console.WriteLine("Press any key to quit ...")
It is a little bit different, I want to obtain PIPoints providing a list of pointID's using AF SDK RDA. similar to FindPIPoint("mypiserver",123) does, but providing a list of pointID's.
I was looking for PIPoint.FindPIPoints Method but I didn't see the option using a list of pointID's.
You can just build a list of points using PIPointList by adding them individually using the FindPIPoints(PIServer, int pointID) method. Points added by ID are not resolved at the time this constructor is used, so this mechanism is fast.
Once you have the list of points, you should resolve them in bulk. The easiest way to do that is use any of the PIPointList methods, such as Snapshot(). The bulk Snapshot() call will also allow you to find any points not resolved via the .Errors collection returned. A word of caution - the points will not have the tag name loaded by default - so if you ask for the point.Name it will cause an RPC. To load the tag names in bulk, use PIPointList.LoadAttributes(PICommonPointAttributes.Tag,PICommonPointAttributes.PointType). You may wish to load other attributes at this time as well - in particular the Step attribute is used often with AF itself for Formula calculations.
Note that the PIPointList.LoadAttributes method in the 2.5.x release does not return individual errors like the data calls (like PIPointList.Snapshot()), so for most situations, LoadAttributes alone is not sufficient unless you know that all ID's will resolve.
than anwers my question.
thanks a lot Gregor and Chris!
I've moved this thread from PI SDK Development to AF SDK Development forum.
Retrieving data ...