gfmalek

Trying to Pull List of PIPoint's Referenced in AF Database

Discussion created by gfmalek on Sep 3, 2020
Latest reply on Sep 4, 2020 by gfmalek

I am trying to pull a list of all PI Points that are referenced by any attribute within an AF database, but the approach I'm using is giving me an error, saying that the query is too complex and not supported by the server. The code I'm using and subsequent error message are included below.

 

This makes sense, because according to this URL (Search Overview), my query is looking up attributes with the token "PlugInName:'PI Point'", which is not enabled for PI AF Server versions older than 2.9.5 (this server in particular is 2.8.5).  However, I'm not sure what other approach I can use to achieve the goal I'm trying to accomplish.

 

Does anyone have any other ideas on how to accomplish this?

 

Thanks for your help,

 

Greg

 

*The compiler highlights the line where "configstrings" is defined as the error source, but based on the error message, I think it's the first line with AFAttributeSearch that is actually causing the error.

 

        public static List<string> GetAttConfigStrings(AFDatabase db)
        {
            AFAttributeSearch attsearch = new AFAttributeSearch(db, "All PI Tags", "Element:{Name:'*'}             PlugInName:'PI Point' ");
            IEnumerable<AFAttribute> AFAtts = attsearch.FindObjects();
            List<string> configstrings = AFAtts.Select<AFAttribute, string>(x => x.DataReference == null ? "" :                         x.DataReference.ToString()).ToList();

 

 

 

            return configstrings;
        }

'System.NotSupportedException: 'The search criteria 'PlugInName' makes the query too complex and is not supported by the server.'

Outcomes