3 Replies Latest reply on Oct 4, 2012 6:04 AM by gies

    Optimization: AF data reference for counting nr of bad/stale tags

    gies

      For monitoring purposes (using notifications) I would like to add a attribute using a custom data reference that counts the number of referenced PI points in its direct children that are currently bad. In the same manner I would also like to add an attribute that counts the number of pi points that are stale. 

       

      My first approach is to simply loop over the elements children and count the number of bad values for the attributes having a PI Point data reference. However, if I add the stale point counting option the loop has to be completed twice. 

       

      Is there any general purpose memory available from a custom data reference where I can cache the results from my loop such that I only have to run the loop once? Or are there any other suggestions? 

       

      Thanks in advance,

       

      Gies

        • Re: Optimization: AF data reference for counting nr of bad/stale tags
          Rick Davin

          One attribute's data reference does not share memory with another attribute's data reference, even if both use the same plug-in.  So yes, you will have to run the loop twice, or once per attribute if you stick with 2 attributes.  Keep in mind that PI caching should boost performance for the 2nd fetch.

           

          Or you have one attribute that does all the counting and stores the results in an array that stores multiple counts.  This would allow you to loop once over the PI Points, but it may also require some other mechanism that pulls a specific item out, e.g. Bad Count = item 0 and Stale Count = item 1.