6 Replies Latest reply on Dec 26, 2017 3:00 PM by Maunik

    moving average of PI tag in AF

    Maunik

      Hi ,

       

      I want to calculate the moving average of PI tag(Every 15 min) in AF. its give me step output rather than continuous output.

      Please suggest the any function available in PI.

       

      Regards,

      Maunik 

        • Re: moving average of PI tag in AF
          John Messinger

          What is the current configuration of your Expression Analysis - can you post a copy of the expression you are using? Also, what is the point configuration of PI Point that is receiving these analysis outputs?

            • Re: moving average of PI tag in AF
              Maunik

              Hi John,

              I am using below mention expression :

               

              1) TagAvg('Sox','*-15m','*')

              2) TagAvg('Sox','*-15m','*-30m')

               

               

              result give me continuous. Also , I am trigger at every 15 min block. It is not give step output.

               

              I want to calculate the avg of 15 min for whole day . I will get the previous 96 block values.

               

              Based on 96 values, I want to trigger notification if its values cross specific limits in 8 blocks.

               

              Regards,

              Maunik 

               

               

               

                • Re: moving average of PI tag in AF
                  Dan Fishman

                  It sounds like this is for environmental compliance and reporting.  Exele Information Systems, Inc. has always faced issues similar to this in our environmental group.  Our product PI-DAS validates data accounting for periods of QA/QC and allows the user to configuration calculations such as rolling averages, and supports reporting on periods that exceed environmental permits as well as downtime.  Often times, we support the real-time calcs and environmental compliance calculations depending on requirements.

                   

                  From what I understand, you want to do the calculation just once a day.  For this, you will have to do manual calculation or use the AF SDK to perform scheduled programmatic calculations. You probably want to set the analysis TagAvg('Sox','*-15m','*') to recalculate once a day.  For our calculations, we recommend using stepped for the calculation and you can do that by setting "step=1".   Take a look at the the method to queue the recalculations here.

                  • Re: moving average of PI tag in AF
                    John Messinger

                    Hi Maunik,

                     

                    So to just confirm, you want to calculate a daily average based on a set of 15 minute averages for the whole day (96 x 15-minute block values). I see this as being a two step process. One analysis would be configured to calculate your 15 minute averages, which will be written to one output point. A second analysis would be configured to then calculate the average of the first analysis results point for the previous 24 hours.

                     

                    John

                      • Re: moving average of PI tag in AF
                        Maunik

                        Hi John,

                        I think you misunderstand little bit, I want to calculate the 15 min average of last 96 block its mean I will get 96 last values.

                        Based on 96 Values, I want to trigger notification based on limit(more than 8 block cross the limit ).

                         

                        Attached PI process book trend & its calculation for ref.

                         

                        Same calculation I have done in PI AF. But I am not sure its give me proper output.

                         

                        8 Hr Trend of 15 min Avg.jpg

                        Processbook cal.jpgPI AF Cal.jpg

                        Regards,

                        Maunik

                      • Re: moving average of PI tag in AF
                        Dan Fishman

                        Yep, John has a great point and you can schedule a three hour rolling average 'TagAvg('Sox15', '*-3h', '*') every three hours using the 15 minute sample.  That works if all you need to do is have real-time data and it is pretty straightforward.

                         

                        I am not sure what regulation you are working with but, often, four valid quadrants are required to make a valid hour, which makes this even more interesting.  Also, reality is more complex due to manual overrides being set after maintenance occur or anomalies around calibration meaning that data has to be recalculated several times!