9 Replies Latest reply on Mar 17, 2011 3:54 PM by mikeloria

    Totalizer End of period Issues

    mikeloria

      I came accross an issue with using the PI Totalizer. I have several totalizers for an operator screen to show totals and statistics over an 8 hour period. At the end of 8 hours, I need the values to zero out and start over. The totalizers are event driven and run when a new value for a particular point is has a new snapshot value. The issue is that at the end of the period, the totalizer does not zero out until a new value for the event driven point exists. This means that in real-time, the operator sees the toalized values zeroing out at different times and there is no way to tell if the values are from the current shift or the previous shift.

       

      I have brought this to the attention of tech support and they have confirmed this to be the case. They have also reccomended that I go to PEs. I would rather use the totalizers because they have many features over the PEs such as using the snapshot and not the archive. Is there any suggestions to this issue where I can still use the totalizers? I am afraid that if I set the totalizer to period, I will lose events since some of the events are 1 second and less.

       

      Here was the tech support response:

       

      Under TotalCloseMOde clock of the pi applications manual (page 223), the
      manual states:

      In this example, although the accumulation ends, the actual close of the
      accumulation does not occur until the rate point updates. This event can
      occur well after the end of the accumulation interval. When the update
      event occurs, the calculated result is written to the Archive with
      timestamps of the actual totalization interval.


      I would recommend using a Performance equation to perform your totals.
      You syntax would be along the lines:

      if hour('*') <7 then eventcount('sinusoid','t', 't+8h') else if ....

       

      Thak you very much for your help in this matter

        • Re: Totalizer End of period Issues
          Ahmad Fattahi

          Mike,

           

          Have you tried scheduling the Totalizer's sampling set to "Whenever the event expression changes"? Depending on your logic it might be feasible to capture all the events as well as the 8-hour mark in such an expression.

           

          Another option I can think of is to inject a dummy event into your source tag programmatically to trigger a recalculation on the 8-hour mark. This could be the exact same snapshot value at that time.

            • Re: Totalizer End of period Issues
              mikeloria

              Thanks Ahmad:

               

              I tried the event expression but I could not find a clean approach. It was counting the events in the totalizing for the end of report. This would need to be filtered out and it was not looking good.

               

              The programmic approach is an option but I was hoping to avoid that just to make it easier to maintain and port the solutions to other facilities.

               

              This is really to bad that there is not a built in trigger in the totalizer that will just zero the value out at the end f the specified period. I am having trouble seeing the business case for not having this. Is there someone who deeply understands the totalizer and the reasoning behind the no autop reset we may consult?

               

              For now, I am looking at the PE solution. The totalizer was such a good fit for this and we were so close.

               

              Thanks again.

                • Re: Totalizer End of period Issues
                  mikeloria

                  It would be nice to see how this could be done in AF or done in AF in the future? My understanding is that AF will have the capability of all the PE functions in the future and also have the ability to write back to the PI archive through the equations. Not sure if there is a feasible solution for the problem above in AF at the moment?

                    • Re: Totalizer End of period Issues
                      skwan

                      Mike:

                       

                      Currently AF does not have a scheduler and also does not have any notion of a "clock" so as it stands right now, AF does not have the functionalities that you need.  I'll forward this to the Analytics Product Manager so he knows about this use case.

                       

                      Thanks,

                        • Re: Totalizer End of period Issues
                          mikeloria

                          Thank Steve

                           

                          I have been working around the no clock in AF by creating a PI Point that has the current time and making it an AF element. I can then use this in multiple places and part of an equation as a conditional argument.

                           

                          I just do not believe That the AF element with current time can be used as any part of an agregate?

                            • Re: Totalizer End of period Issues
                              skwan

                              Mike:

                               

                              Yes, you can certainly do an aggregate easily in AF.  As a matter of fact, you can use an AF element attribute that is a PI point data reference to a Totalizer point if that helps you any.  My point earlier was that someone would need to manually do the aggregation at the 8 hour mark in your case.  My understanding was that you wanted to do this automatically and without coding, AF cannot do this since it doesn't have a "clock" or really a scheduler right now.

                                • Re: Totalizer End of period Issues

                                  Mike,  Can you describe your use case in some detail - i.e. how's the Totalizer value being used, are you just wanting 8 hour totals?

                                    • Re: Totalizer End of period Issues
                                      mikeloria

                                      The value from the totalizers is being displayed on a screen that is being monitored by operators in real-time so I have write interim results set to at source time(ramp) because I need the accumilation to be written continually. Because it is being viewed in real-time, I also need to have it zero out at the end of every shiift. Every 8 hours.

                                       

                                      The totalizer is counting events and is being filtered. I have it running everytime the source tag has a new event because the event that I am looking for happens in 1 second or less.

                                       

                                      The problem is that there may only be 30 events in an 8 hour period. At the end of the 8 hour period I want it to zero out but it does not zero out until the next event which could be sometime after the 8 hour period. There are about 8 totalizers on the screen so having them zero out at different times is very confusing to the customer.

                                       

                                       

                                        • Re: Totalizer End of period Issues
                                          mikeloria

                                          Thanks everyone for all your input on this one

                                           

                                          I ended up using a performance equation to increment everytime a new event occurred. I could not find a PE function that would count events and also filter events so that only certain events would be counted so I made an incremental PE (A PE that increments everytime a new filtered event exists). I am using a second PE to handle the summing per turn. I reference the second PE in AF so that I have a nice organized AF element with all the shift summary information.

                                           

                                          Here is what the second PE looks like:

                                           

                                          if int(hour('*')) < 8 then EventCount('CPL:DoubleCoilProduced','t','*') else if int(hour('*')) < 16 then EventCount('CPL:DoubleCoilProduced','t+8h','*') else EventCount('CPL:DoubleCoilProduced','t+16h','*')

                                           

                                          It would be nice to be able to do this functionality directly in an AF element which I believe may be possible from what I understand.