2 Replies Latest reply on Oct 12, 2015 1:44 PM by bala

    How to properly totalize a flow tag

    jmgilman

      Greetings,

       

      I have an instantaneous flow tag in the units of GPM that I am trying to totalize over a 24 hour period. I'm attempting to use PI Datalink to obtain a month's worth of this totalized data. The issue I'm running into is the perceived inconsistencies I see within the data being returned.

       

      For instance, I setup the following two Calculated Data queries:

       

      • Tag: Flow (GPM)
      • Time Interval: 1d
      • Conversion Factor: 1
      • Calculation Mode: average
      • Calculation basis: time-weighted
      • Expression Sampling: interpolated

       

      • Tag: Flow (GPM)
      • Time Interval: 1d
      • Conversion Factor: 1440
      • Calculation Mode: total
      • Calculation Basis: time-weighted
      • Expression Sampling: interpolated

       

      Taken one day at random, I get the following data:

       

      • Average flow (first query): 46.67 GPM
      • Totalized flow (second query): 53,119.61 Gallons

       

      Now, if we do the math: 46.67 * 1440 = 67,204.8 Gallons

       

      Where did the extra 10,000+ gallons go? Isn't the total function just basically averaging the flow for the day and then multiplying by the conversion factor?

       

      This particular data has legal requirements to be accurate and I would like to understand what the most accurate method is for totalizing a flow tag.

        • Re: How to properly totalize a flow tag
          Marcos Vainer Loeff

          Hello Joshua,

           

          I wasn’t able to reproduce your issue with the cdt158 PI Point. Here is what I have done:

           

          • Tag: Cdt158
          • Time Interval: 1d
          • Conversion Factor: 1
          • Calculation Mode: average
          • Calculation basis: time-weighted
          • Expression Sampling: interpolated
          • Start Time: t-30d
          • End Time: t

           

          • Tag: Cdt158
          • Time Interval: 1d
          • Conversion Factor: 1
          • Calculation Mode: total
          • Calculation Basis: time-weighted
          • Expression Sampling: interpolated
          • Start Time: t-30d
          • End Time: t

           

          On each calculation data, I have received 30 values (one value per day). Both 30 values are exactly the same. As both time intervals are 1d, both conversion factors should be 1.

           

          If you reproduce with the information above on your environment, what do you get?

          • Re: How to properly totalize a flow tag
            bala

            You could use PI Totalizer  tag for getting accurate flow totals.

            Below KB article might be useful for setting up a totalizer tag.

            KB00793 - How to set up a PI Totalizer point to do a Monthly or Daily Integral (Time Weighted Total) of a rate tag

             

            If you are just trying to sum up the tag values over a time range you should use event weighted as time weighted scales the values by how long the tag was at that particular value.

             

            Try modifying the calculation basis as Event-Weighted.