5 Replies Latest reply on Feb 20, 2014 2:01 PM by matthew.rivett

    Length of time AF attribute was specified value

    matthew.rivett

      I can't find a better place to post a question about AF.  I'm hoping I can do this without use of the AF-SDK by using an AF attribute with a formula.

       

      I know this has always been kind of tricky to do in PI.  I think you always have to specify a start and end time for your formula.  I need to know if an AF attribute is equal to 61488 and if it is I need to know how long it has been that value.  The next issue is that the value gets written to the archive every 1 second with our compression setup. Here is the pseudo code and the result would be time in seconds or some other unit.

       

      if attribute = 61488 then

       

        now - first contiguous occurrence of 61488

       

      else

       

        0

       

      end if

       

      My guess is that this is probably something you'd want to use event frames for but I don't want to use them until Abacus/Configured Analytics are available (for a production environment) to create event frames for me.

       

      Any ideas?

       

      Thanks,

       

      Matt

        • Re: Length of time AF attribute was specified value
          skwan

          Matt:

           

          Formula DR only evaluates on demand so it currently cannot monitor real time data.  Sounds to me like you want to monitor the 1 sec data that is coming into the archive.  Did I get that right?

            • Re: Length of time AF attribute was specified value
              matthew.rivett

              This would work for some things and not others.  In my example it would be ok since the attribute is a tag reference and I'd be display the result on a process book display.  I have no need to setup notifications on the value.  

               

              However the end state for this is using a rollup as a source.  I need to know if the status of all the elements at a particular site is equal to 61488.  If they are then we can assume the site is down and we want to know how long it has been down.  I know using a rollup is going to cause major issues unless it's being written back to PI via abacus.

               

              I'm still interested to see how it could be done with existing technologies.  I could always use ACE but then I lose AF templates which I quite like.

                • Re: Length of time AF attribute was specified value

                  Hello Matt,

                   

                  To evaluate the length of time an AF attribute is at the same value, Abacus is required. AF formula DR won't work because the DR has no idea when an attribute is at a particular value as the DR requires the user to refresh. In AF 2.6 we are adding data pipe for AF attributes but to use this feature, you would need to write your own code. The formula DR won't do it.

                    • Re: Length of time AF attribute was specified value
                      Robin Verhoek

                      Some out-of-way options:

                       

                      If you just want to know, PI Notifications could be an option. It will allow to define a trigger for the given value (e.g. using a Performance Equation). When the tag receives a different value, the Notification will be closed and from the start and endtimes you can calculate the duration.

                       

                      To get the value in an AF Attribute, all of the previous answers apply.

                       

                      Another option could be to develop a custom DataReference that allows you to execute a Performance Equation. Easy done using the AFSDK, but this might also not be the solution direction you are looking for.