7 Replies Latest reply on Apr 21, 2014 12:26 PM by Marcos Vainer Loeff

    Priority on PI

    marco.zoccoli

      Hi all,

       

      I have a tag on an interface PI UFL, every 10 minuts with a new value:

       

      ex

       

      UUUU, 7, 05:50:00

       

      UUUU, 7, 06:00:00

       

      UUUU, 4, 06:10:00

       

      UUUU, 4, 06:20:00

       

      UUUU, 4, 06:30:00

       

      UUUU, 4, 06:40:00

       

      UUUU, 4, 06:50:00

       

      UUUU, 4, 07:00:00

       

      UUUU, 9, 07:10:00

       

       

       

      another tag, XXX, with a PE, calculates the sum of UUU in the previous hour. The tag XXX run every hour:

       

      XXX, 87, 6:00:00

       

      XXX, 24, 7:00:00

       

      XXX, 56, 8:00:00

       

      i would like to collect, in tag XXX at 7:00:00,  the value of tag UUU starting from 6:10:00 to 7:00:00. If tag UUU and XXX run at the same time (7:00:00), I don't know if the value of UUU at 7:00:00 is considered in the calculation of XXX.

       

      It's possible to define in the PI a priority (for example, first collect all tags from interface, second calculate all tags with PE)? If not possible, how the PI work usually?

       

       

       

      Thanks and  regards,

       

      Marco

        • Re: Priority on PI
          mhalhead

          Hi Marco,

           

          Indirectly you can do this. You could configure the PE tag to be event triggered and then write some logic to only calculate on the hour. Without knowing too much about your problem a more appropriate solution might be to use a totalizer. The one possible danger with a totalizer is that you might miss the values at the end depending on when UFL reads the data.

            • Re: Priority on PI
              marco.zoccoli

              Hi Michael, thanks for your reply. How can I implement this logic?

               

              -  "You could configure the PE tag to be event triggered and then write some logic to only calculate on the hour" -

               

              I think that if the PE has an event triggered, the calculation is made when the tag UFL change, so every 10 minuts.

               

              Thank,

               

              Marco

                • Re: Priority on PI
                  Marcos Vainer Loeff

                  Hi Marco,

                   

                  You can check the snapshot of the UUU tag before calculating the sum and store on the PE tag XXX. If the timestamp of the snapshot is on top of the hour, then the calculation can be done. In order to do that, you can use a similar expression below:

                   

                  if minute(prevevent('uuu','*'))=0 then 1 else nooutput()

                   

                  You can open PI SMT and click on the "Evaluate" button under the Equation ribbon of the Performance Equation section in order to view the results.

                   

                  Hope this helps you!

                    • Re: Priority on PI
                      marco.zoccoli

                      Hi Marcos,

                       

                      I'm trying  to follow your suggest, and i have a question  for you: which scheduling must have the tag XXX? 1h?

                       

                      I think that the expression "if minute(prevevent('uuu','*'))=0 then 1 else nooutput()" allow to have value for tag XXX every hour (i.e. when the timestamp of 'uuu' is 7:00:00, 8:00:00,.., correct me if I'm wrong), but the timestamp for tag XXX is effectively 7:00:00, 8:00:00. ...?

                       

                      Thanks,

                       

                      Marco

                        • Re: Priority on PI
                          Marcos Vainer Loeff

                          Hi Marco,

                           

                          The tag XXX should be triggered every time tag UUU receives a new value. But the point is that the condition will be true only when the new value is received on top of the hour (when the minute is zero).

                           

                          The other option would be to set up tag XXX to be triggered every minute.

                           

                          These options should work well but there might be some delay on the timestamps of the XXX tag. For instance, the timestamp could be 7:02:00 when it was supposed to be 7:00:00. You can make some tests to check what happens.

                           

                          If this is a problem for you then PI Performance Equation cannot be used since it is able only to write current values (snapshot = current time).

                           

                          In this case, PI ACE is able to solve this problem for sure but you might consider our most new analytics product: PI Analysis Service 2014. I am not very familiar with this new product, but if you are willing to consider this option, we can make some tests in order to find out if it solves your problem.

                           

                          Hope this helps you!

                            • Re: Priority on PI
                              marco.zoccoli

                              Hi Marcos,

                               

                              I have tested your solution: this is perfect for my problem, and i can solve the problem of timestamp by using two trigger: but it doesn't work. The question is:

                               

                              Can I have a tag AAA,event on ZZZ, and a tag BBB,event on AAA +  your expression implemented? It seems that tag BBB lost, in his calculation, the last value archived for tag AAA on 7:00:00 (take 6 values from 6:00 to 6:50), but the timestamp of BBB it's correct... Can you explain this behavior?

                               

                              Thanks a lot for your help.

                               

                              Marco

                                • Re: Priority on PI
                                  Marcos Vainer Loeff

                                  Hello Marco,

                                   

                                  Actually, I couldn’t understand what you did on your examples. Perhaps you can show us an example with numbers and timestamps?

                                   

                                  Even using two triggers, I don’t think you will achieve your goals with PI Performance Equation tags only. The reason is that you cannot create new values on the past. Do you know how much time it takes for the data within the files read by the PI UFL interfaces reaches the PI Server? I supposed it is not instant.

                                   

                                  I will give you an example. Let’s suppose a new value was written to a file: value 70 and timestamp 07:00:00. The value is received by the PI Server at 07:02:00 and is stored on tag AAA. The sum of the last 6 values could be calculated and stored on a PE tag called BBB, but the timestamp cannot be 07:00:00 using PI Performance Equation, as it cannot write values on the past. You could write a random value at 07:00:00 and then use PI Recalculator to recalculate this value to the correct value. This solution works but it is difficult to maintain since you probably will need to manually request this application to recalculate the chosen tags.

                                   

                                  If you use PI ACE for instance, you have the control of the timestamp, so even if you are making this specific calculation at 07:02:00, the new timestamp could be 07:00:00 (two minutes in the past).

                                   

                                  Does this describe your issue?