3 Replies Latest reply on Jun 26, 2014 4:39 PM by Marcos Vainer Loeff

    Get a PIPoint from PIPointList

    kkolli

      Hi, 

       

       

       

      I have the following code to get the PIPointList for a particular PointSource.

       

       

       

      PIPointQuery searchfilter = new PIPointQuery("pointsource", OSIsoft.AF.Search.AFSearchOperator.Equal, "XYZ");
      List<PIPointQuery> conditions = new List<PIPointQuery>();
      conditions.Add(searchfilter);

       


      PIPointList piptlist = new PIPointList(OSIsoft.AF.PI.PIPoint.FindPIPoints(piServer, conditions, null));

       

      Is there a way to get a specific point from the PIPointList? something like 

       

      piptlist .Select()?

       

      In other words , Can i query the existing PIPOINTList for a specific point?

        • Re: Get a PIPoint from PIPointList
          Marcos Vainer Loeff

          Hello Keerthi,

           

          There is no function that would retrieve a PIPoint object from a PIPointList by specifying its name.  I believe the reason is that if you already know the name of the PIPoint, you can create the object directly using FindPIPoint method.

           

          Nevertheless, you can easily create this function  Iterating through all PIPoint objects within the PIPointList  object. You just need to compare the names between a string and PIPoint.Name property.

           

          Hope it helps!

            • Re: Get a PIPoint from PIPointList
              kkolli

              Hi Marcos,

               

              Thats what i have as an alternate approach. i was wondering if there is an existing method that i overlooked. Thanks for confirming. The reason, i am not querying for each point is , i am trying to improve performance by reducing the number of calls for one of my requirements.

               

              Thank you for your help. Much appreciated.

                • Re: Get a PIPoint from PIPointList
                  Marcos Vainer Loeff

                  You can use the PIPointList.Contains Method to check if the collection contains a specific PI Point. And also you can use the PIPointList.IndexOf Method which searches for the specified object and returns the zero-based index of the first occurrence within the entire collection. I am not sure if they are useful to you though.