AnsweredAssumed Answered

Can't post question - AF SDK can't find PIPoint when SMT can

Question asked by RobBowman on Jun 22, 2017
Latest reply on Jun 27, 2017 by rdavin

When I try to post a question I get "Your content could not be saved due to an error. You may have been logged out. If this problem persists please contact your system administrator. Click here to refresh this page."




I have C# application that creates a new Pi Point using the code based on  PI-AF-SDK-Basic-Samples/CreatePIPointsExample.cs at master · osisoft/PI-AF-SDK-Basic-Samples · GitHub


The point seems to be created ok - here's a screen grab following a tag search in SMT:




My problem is, when my same C# application searches for the newly created Pi Point is doesn't find it. The code for the search is as follows:


private static List<PIPoint> GetPiPoints(PIServer piServer)
            var criteria = GetCriteria("61");
            var foundPoints = PIPoint.FindPIPoints(piServer, criteria).ToList();

            criteria = GetCriteria("63");
           foundPoints.AddRange(PIPoint.FindPIPoints(piServer, criteria).ToList());

            criteria = GetCriteria("64");
            foundPoints.AddRange(PIPoint.FindPIPoints(piServer, criteria).ToList());

            return foundPoints;

private static List<PIPointQuery> GetCriteria(string location)
            List<PIPointQuery> criteria = new List<PIPointQuery>();

            PIPointQuery whereClause1 = new PIPointQuery(PICommonPointAttributes.Location1, OSIsoft.AF.Search.AFSearchOperator.Equal, location);
            PIPointQuery whereClause2 = new PIPointQuery(PICommonPointAttributes.PointSource, OSIsoft.AF.Search.AFSearchOperator.Equal, "o");


            return criteria;



So, my understanding is that this should find all points that have a "location1" attribute value of 61, 63 or 61 AND a "pointSource" of "o" - I have tried uppercase and lower case "o"


From the screenshot, you can see that this is the case for the newly created "Kuba_99x" tag yet it is not found in the search, although thousands of other existing tags are.


Any ideas where I went wrong please?