7 Replies Latest reply on Nov 27, 2018 2:58 PM by gregor

    TagTot for day and month

    igreguri

      I want to check if I'm right...

      Using function TagTot I want to calculate total today and total for 1 month.

      I first calculated averages for today and for current month.

      Then multiply this with TagTot for day and month total.

      Is that OK or has a better way?

      Regards,

      Igor

        • Re: TagTot for day and month
          Eugene Lee

          You can just use the raw process tag 'Mass' with TagTot like this for total today

          TagTot('Mass','t','*')

           

          and like this for current month total.

          TagTot('Mass',Bom('*'),'*')

          1 of 1 people found this helpful
            • Re: TagTot for day and month
              igreguri

              In this way result is a bit more precise.

              You can see a comparison...

                • Re: TagTot for day and month
                  Eugene Lee

                  The result that you get by using TagMean is not correct. TagMean calculates the event-weighted average of the tag which is probably not what you want. If you want the time-weighted average, you can consider TagAvg.

                  3 of 3 people found this helpful
                    • Re: TagTot for day and month
                      igreguri

                      Thanks!

                      • Re: TagTot for day and month
                        igreguri

                        Something else is not clear to me...

                        If you look at the picture you will see that the average production today is (AVRToday) 124.94 kg/h.    

                        TotalToday (for 11 hours of work) give result 675.05, which is not logical because it should be 124.94 x 11 h = 1374.34

                        Why did wrong totalizes total amount?

                          • Re: TagTot for day and month
                            Eugene Lee

                            You will need to take into account conversion factors as well. The default is always assumed to be "per day" for the rate tag. Please look at the link for a more information.

                             

                            KB01585 - How Time-Weighted and Event-Weighted Totals and Averages Work

                            2 of 2 people found this helpful
                            • Re: TagTot for day and month
                              gregor

                              Hello Igor,

                               

                              I find it difficult to asses if the calculation returns the correct result without knowing the raw data. For this reason, I suggest you to use PI DataLink to retrieve compressed values for a certain day and to use Excel to see if you could reproduce the results. Please note that there is quite some difference between calculating time- or event-weighted. When you are able to say that the daily results are good, you can look into the monthly ones.

                               

                              One thing to note is that while the 'Evaluate' button allows to check if the formula is generally working, you should not take the 'evaluated' results as real. I don't recall the exact details but that the results showing here are not trustworthy because formula's are evaluated at current time. So, please only compare real formula evaluations performed by the Analysis Processor. At least for the assessment of calculation results, you may want to map the output to a PI Point Attribute but I also like to suggest this in general. With a static Attribute, you will not be able to check this month's Total against the previous month's Total.

                               

                              When building a daily Total and a monthly Total, it may be wise to use the daily Total as input for the monthly calculation. My expectation here is that the amount of archived events with the daily Total is way less than with the raw point but that calculating based on daily values is still accurate.

                              1 of 1 people found this helpful