5 Replies Latest reply on Aug 24, 2016 2:59 PM by bpayne

    Inconsistent behavior of FindPIPoints

    dpilc

      When querying PI via AF SDK, I've run into a problem which, I think, is a bug. FindPiPoints method behavior is not consistent:

      • when called with two identical PIPointQuery conditions tag name like '*' it returns a list of PIPoints with duplicates - each point is repeated
      • when called with two identical PIPointQuery conditions tag name like 'AAA*' it returns a list of distinct PIPoints (no duplicates, assuming there are some tags with names beginning with AAA)

      The only difference is that there are non-wildcard characters in the second query.

       

      Try the following snippet:

      PIPointQuery[][] qList = {new PIPointQuery[] { new PIPointQuery("tag", OSIsoft.AF.Search.AFSearchOperator.Equal, "*") },

                                new PIPointQuery[] { new PIPointQuery("tag", OSIsoft.AF.Search.AFSearchOperator.Equal, "*")} };

       

      IEnumerable<IEnumerable<PIPointQuery>> conditions = qList.ToList();

      PIPoint.FindPIPoints(myPIServer, conditions.ToList());

       

      This happens on PI Server 2016 and PI AF SDK 2015 R2.

        • Re: Inconsistent behavior of FindPIPoints
          bpayne

          Hello Dawid,

           

          I have duplicated your issue and we are looking into it. Can you tell me what is the use case for this query?

            • Re: Inconsistent behavior of FindPIPoints
              dpilc

              Hello Butch,

               

              actually, I've run into this by accident and my use case won't make much sense to you. I wanted to test the performance of FindPiPoints when there are multiple conditions for tag name (like 1000 OR'd conditions of the form: tag name like something* - it's a requirement from my client). Originally, these conditions were supposed to be pairwise distinct but the quickest way for me to test it was:

              • list all tag names,
              • remove a couple of trailing characters from these names and add a wildcard at the end.

              Doing this I generated a good candidate list for my performance tests but, regrettably, some tag names were originally short enough to be converted to a single asterisk. And there were several such asterisks present in the list. When I passed this list to FindPiPoints I got many more results than I would otherwise get by listing all tags and I was kinda surprised. I then narrowed the query to the one shown in my original post to nail down the reason of this behavior. Hope this clarifies things.

               

              Regards,

              Dawid