6 Replies Latest reply on May 31, 2013 6:26 PM by skwan

    AF attribute that returns a 15 min average over a time range

    viletbounnam

      is it possible to have an AF attribute that references a formula to calculate a 15 min average over a specified time period?  What I would like to do is calculate a 15 min average over a day for a PI Point then find the max of those 15 minute averages.  I've done this in VBA code using ipiCalc in the pi-sdk.  I would now like to do this in AF and build this as an attribute using the PI System Explorer.

       

       

       

      thanks, 

        • Re: AF attribute that returns a 15 min average over a time range
          xwang

          Hi,

           

          This function could be better to use PI Totalizer.  After this, you could use PI Point Data Reference to show this in the PI AF.

           

          If you prefer to do the a reference, please go to v-Campus TRAINING CENTER to download the material of 'PI Application Development Course'.  In this course, you will learn how to do a customized data reference.  You could use PI SDK and AF SDK for this developing, so if you have ever used ipiCalc to achieve your goal, it could work in the data reference as well.

           

          Xi Wang

           

          v-Campus engineer  

            • Re: AF attribute that returns a 15 min average over a time range
              hanyong

              If you are looking at alternatives without doing this programmatically using IPICalculation class in PI SDK, you can create a Performance Equation (PE) tag or PI Totalizer tag that calculate and store the 15 minutes average of input tag like what Xi recommended.

               

              When you reference the PE tag in AF using the PI Point Data Reference, configure the attribute to get the max within the last 1 day (below). This should give you the max of 15 minutes average value in the last 1 day.

               

              6471.AFPIPointDR001.jpg

               

               

               

              When Abacus is released, you should be able to do this with it.

               

              Han Yong

                • Re: AF attribute that returns a 15 min average over a time range
                  viletbounnam

                  is there a link to more information about Abacus?

                  • Re: AF attribute that returns a 15 min average over a time range
                    Asle Frantzen

                    Han Yong

                    When you reference the PE tag in AF using the PI Point Data Reference, configure the attribute to get the max within the last 1 day (below). This should give you the max of 15 minutes average value in the last 1 day.

                     

                    Remember to use the "Time Range Override" option, instead of the one in Han Yong's picture. "Time Range" will use which ever time range your client uses, and if you look at the attribute from ProcessBook - and have 4 days as time range there - that time range will be applied to the AF attribute and used instead. From my understanding the "Time Range" option is just a default time range to be used unless the client specifies a time range (like PI System Explorer). If you want to make sure the time range you specify is being used at all times use the "Time Range Override" option, which will always evaluate from the client's end time and backwards.

                      • Re: AF attribute that returns a 15 min average over a time range
                        skwan

                        From the PI System Explorer 2012 User Guide:

                         

                        Configure Value Retrieval by Time Range

                         

                        If you want the attribute value to be the result of a summary calculation over a time range,

                         

                        configure the value retrieval as follows:

                         

                        1. Choose one of the following options in the

                         

                         

                         

                        By Time drop-down menu.

                         

                        Not Supported: If the client application sends a time instead of a time range, then PI AF returns an error message as the attribute value.

                         

                        Time Range: Create a default time range to use if the client application sends a time, instead of a time range. If you choose this option, you must type a PI relative time expression in the Relative Time box. See Create a Default Time Range (page 92) for details.

                         

                        Time Range Override: Specify a time range that always overrides the time range specified by the client application. You can specify a fixed duration for the range (Create a Range of Fixed Duration (page 88)) or you can calculate the duration dynamically (Dynamically Calculate Time Range (page 89)).