3 Replies Latest reply on Jun 5, 2012 11:09 PM by Ahmad Fattahi

    Performance Calculation by Event Trigger uses older value?

    paroda

      Hi,

       

      I have several PE calculation which are triggered by Event of the input PI Tags. However, one common issue i found with all of them. please refer the graphic below.

       

      4747.pecalc.png

       

      The blue line is the input tag and the blue circle shows the archived events. there were more events inbetween but got omitted due to compression. The excmax attribute is set at 600s. The green and yellow ones represent two PE calcs based on this PI tag. They are (Tag * 0.98) and (Tag * 1.02).

       

      Please observe the time shown by red 1. There is a blue circle showing an event for the input tag. Also green and yellow dots are also there showing the PE calcs. But their value corresponds to the blue circle on the left. Similarly on next instance (2), the calculated value again corresponds to the previous value of the input tag. On the next instance (3), the blue circle is missing as it got omitted on compression. The time gap between 2 & 3 is 10 min which corresponds to excmax value of the input tag. So on overall we get a kind of impression that the PE Calculated values are offset by 10 min, while in fact the PE calculation based on event trigger is taking the older value of the tag for calculation.

       

      Maybe I have misinterpreted it. We just want to have PE calculated values to be in sync with the input PI Tag. How to fix it?

        • Re: Performance Calculation by Event Trigger uses older value?
          Ahmad Fattahi

          One possibility is that the difference stems in archive vs. snapshot values of the input tags. Note that as the trigger goes, a snapshot event triggers a new calculation for a PE; however, for the calculation, the archive value is used. Can you leave the trigger value the same but use a separate tag for the calculation (Tag*0.98 with a third tag) and see if it responds with the snapshot event of the trigger tag?

           

          On a related note, have you looked into Totalizers? The main difference between a Performance Equations point and a Totalizer point calculating the same summary is that Totalizer calculates based on Snapshot events while the Performance Equation Scheduler calculates based on Archive events. Thus, a Totalizer point may have more accurate results.

            • Re: Performance Calculation by Event Trigger uses older value?
              paroda

              Though PE takes the input from Archive, the latest value should be snapshot. I created a test input tag and a test PE tag. and populated the test input tag using PIPoint.Data.UpdateValue. As shown below, it can be seen that PE closely follows the input tag.

               

              7345.pecalc2.png

               

              In the original case, the input tags are fed by PI OPC interface. After further check i found that the PE calculation is happening just 5 secs before the new snapshot. To illustrate, given below is a few datapoints from PI.

              Input Tag Tag * 1.02 3:37:54 PM 0.7     3:39:29 PM 0.4 3:39:24 PM 0.714 3:45:14 PM 1 3:45:09 PM 0.408 3:51:24 PM 2 3:51:19 PM 1.02

              Not sure what is causing this. The OPC interface scan period is 5 secs. But i don't think there is one more snapshot 5 sec before to trigger PE calc. Also the server and interface time difference is less than 1 sec. I have set the PE timestamp to be same as source triggering event's timestamp. Any idea where to look at?

               

              By the way PI totalizer point is good for summary calculation over a time range. I dont know how to use it to calculate using the snapshot only. Also how to apply a custom formula in totalizer.

                • Re: Performance Calculation by Event Trigger uses older value?
                  Ahmad Fattahi

                  As for your test case, are you positive that the events don't make it (almost) instantaneously to the archives? In general what I said in my previous post is still true (PE's calculation is based on archive values); you can read more about it in the PI Server Application User Guide. In your OPC interface case things can be more complex. The 5 second scans pass through exception first. Then there is the possibility of letting the interface attach the timestamp on its own or takes the timestamp from the OPC server. When the event makes it to the server, then there is compression...

                   

                  Another possibility is that when the snapshot event happens at 3:39:29 it pushes the existing snapshot event (at 3:39:24) to the archive (compression). This archive event, in turn is used in the calculation of the PE resulting in an archive event timestamped at 3:39:24 for the PE. 

                   

                  I would courteously suggest you follow up this case with Tech Support. They can have a live session with you tracking down the events and checking your interface settings. Looking forward to seeing your programming-related questions on vCampus