5 Replies Latest reply on May 19, 2011 10:29 PM by charlie@osisoft.com

    GetPoints along with type information takes longer than expected.


      I need to get a list of tags along with their type.

      PointList points = this.TheOsiPiServer.GetPoints("tag = '*'");
      foreach (PIPoint pt in points)
         coll.Add(new Obj(pt.Name, pt.Description, pt.PointType))



      When executing this code, it seemed to be very slow for a system with 30K tags.


      Is there a more optimal way of doing this?
      What can I do to speed it up. 

      Can the use of attributes help? 



        • Re: GetPoints along with type information takes longer than expected.
          Ahmad Fattahi

          Using the AttributeSets Collection should help expedite the process instead of looping over all the points on the server. An attribute set is a collection of point attributes.  One or more AttributeSet objects are combined to construct a PointClass. In the PI-SDK an attribute set is represented by a PointAttributes collection.


          A point class (represented in the PI-SDK as a PointClass object), is a template of attributes from which a point can be created. New point classes can be created on some servers using the PointClasses.Add method passing the names of one or more of the server’s attribute set definitions. These sets together describe the desired attributes for a new point template or point class.


          The AttributeSets collection contains one or more attribute set definitions represented as PointAttributes collections. An AttributeSets collection is available from a Server object representing all of the available attribute set definitions stored on the server. An AttributeSets collection is also a available as a property of a PointClass object and in that instance represents the attribute sets that make up the PointClass. This object supports the IRefresh interface.


          Hope it helps!