13 Replies Latest reply on Aug 24, 2017 10:33 AM by Muthulingam-EnQuest

    Can we create a PI Calculation Point which can read from multiple PI Points at different Time Intervals?

    Muthulingam-EnQuest

      I have Multiple PI Tags which display's an Hourly Average of Daily Hourly Production Tracking (Nett Oil Volume)  from 0600 hrs of the First Day to 1800 hrs and from 1800 hrs to 0600 the Next Day.

      My clients wants a Tag which can actually switch from Hour to Hour.

       

      Is there a Calculation Logic which I can use to assign a PI Calculation Tag so that it reads from different PI Point at different Time Intervals?

       

      Best Regards,

       

      Muthulingam Ramiah

      Senior Systems Consultant

       

      Ganesh Supromaniam

        • Re: Can we create a PI Calculation Point which can read from multiple PI Points at different Time Intervals?
          janospetro

          Hello Muthulingam,

           

          Yes of course, You can do PE calculations reading different tags at different time intervals.

          Just an fictionary example:

          If (Hour('*')>6 and Hour('*')<=18) then TagVal('tag1','*') else Tagval('tag2','*-1d')

           

          Although it is not clear to me, what do You mean on "switching from Hour to Hour"!?

          Do You have 24 different tags holding the hourly averages, You wish to merge into one single tag??

           

          Regards,

          Janos

          3 of 3 people found this helpful
          • Re: Can we create a PI Calculation Point which can read from multiple PI Points at different Time Intervals?
            gmichaud-verreault

            János Petró already provided a great example, but if you have Analysis available, I would suggest creating those tags in Analysis which will be more reliable and also allow you to backfill this tag for as long as you wish.

             

            Gabriel

            3 of 3 people found this helpful
                • Re: Can we create a PI Calculation Point which can read from multiple PI Points at different Time Intervals?
                  Muthulingam-EnQuest

                  Hi János Petró,

                  Yes, the Tags are changing in an Hourly Shift to each other.

                  So, like you've suggested, a long If-Then-Else Logic would be the right approach.

                   

                  Thanks again guys.

                  János Petró

                  Gabriel Michaud-Verreault

                   

                  cc:

                  Ganesh Supromaniam

                  • Re: Can we create a PI Calculation Point which can read from multiple PI Points at different Time Intervals?
                    Muthulingam-EnQuest

                    HI Janos,

                    I've created the below equation and it seems to work in PI ProcessBook Display "Datasets" Function but not in PI SMT.

                    To create an actual Tag in PI SMT, do I have to declare the "Event tag" for the below Equation?

                    If yes, is there a way I can declare the "Event=" for 24 different Tags?

                     

                    Equation 1 - Works perfectly in PI Datasets, but can't program into a PI PE Calculation Tag.

                    max(TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_1','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_2','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_3','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_4','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_5','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_6','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_7','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_8','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_9','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_10','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_11','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_12','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_13','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_14','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_15','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_16','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_17','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_18','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_19','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_20','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_21','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_22','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_23','*+1h'),TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_24','*+1h'))

                     

                    Equation 2 - Works partially in PI Datasets, but can't program into a PI PE Calculation Tag.

                    if(hour('*')+1=1) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_1') else (if(hour('*')+1=2) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_2') else (if(hour('*')+1=3) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_1') else (if(hour('*')+1=4) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_4') else (if(hour('*')+1=5) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_5') else (if(hour('*')+1=6) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_6') else (if(hour('*')+1=7) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_7') else (if(hour('*')+1=8) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_8') else (if(hour('*')+1=9) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_9') else (if(hour('*')+1=10) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_10') else (if(hour('*')+1=11) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_11') else (if(hour('*')+1=12) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_12') else (if(hour('*')+1=13) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_13') else (if(hour('*')+1=14) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_14') else (if(hour('*')+1=15) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_15') else (if(hour('*')+1=16) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_16') else (if(hour('*')+1=17) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_17') else (if(hour('*')+1=18) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_18') else (if(hour('*')+1=19) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_19') else (if(hour('*')+1=20) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_20') else (if(hour('*')+1=21) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_21') else (if(hour('*')+1=22) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_22') else (if(hour('*')+1=23) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_23') else (if(hour('*')+1=24) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_24') else (0))))))))))))))))))))))))

                     

                    Equation 3 - Works partially in PI Datasets, but can't program into a PI PE Calculation Tag.

                    if(hour('*')=0) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_1') else (if(hour('*')=1) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_2') else (if(hour('*')=2) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_1') else (if(hour('*')=3) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_4') else (if(hour('*')=4) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_5') else (if(hour('*')=5) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_6') else (if(hour('*')=6) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_7') else (if(hour('*')=7) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_8') else (if(hour('*')=8) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_9') else (if(hour('*')=9) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_10') else (if(hour('*')=10) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_11') else (if(hour('*')=11) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_12') else (if(hour('*')=12) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_13') else (if(hour('*')=13) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_14') else (if(hour('*')=14) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_15') else (if(hour('*')=15) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_16') else (if(hour('*')=16) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_17') else (if(hour('*')=17) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_18') else (if(hour('*')=18) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_19') else (if(hour('*')=19) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_20') else (if(hour('*')=20) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_21') else (if(hour('*')=21) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_22') else (if(hour('*')=22) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_23') else (if(hour('*')=23) then TagVal('MY.SEA.45DAILY_PROD.ACCUMULATED_24') else (0))))))))))))))))))))))))

                     

                    All the above Equations comes out as "Calc Failed" after I evaluate it in PI SMT Performance Equation.

                     

                     

                    Best Regards,

                     

                    Muthulingam Ramiah

                    cc:

                    Ganesh Supromaniam

                    Gabriel Michaud-Verreault

                      • Re: Can we create a PI Calculation Point which can read from multiple PI Points at different Time Intervals?
                        Muthulingam-EnQuest

                        Hi friends,

                         

                        It was a simple Logic Error:

                         

                        Equiation 1 - Works fine in PI Dataset now, but I still need help on how to turn this into a proper PI PE Point.

                         

                        if(hour('*')=0) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_1','*+1h') else (if(hour('*')=1) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_2','*+1h') else (if(hour('*')=2) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_3','*+1h') else (if(hour('*')=3) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_4','*+1h') else (if(hour('*')=4) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_5','*+1h') else (if(hour('*')=5) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_6','*+1h') else (if(hour('*')=6) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_7','*+1h') else (if(hour('*')=7) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_8','*+1h') else (if(hour('*')=8) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_9','*+1h') else (if(hour('*')=9) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_10','*+1h') else (if(hour('*')=10) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_11','*+1h') else (if(hour('*')=11) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_12','*+1h') else (if(hour('*')=12) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_13','*+1h') else (if(hour('*')=13) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_14','*+1h') else (if(hour('*')=14) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_15','*+1h') else (if(hour('*')=15) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_16','*+1h') else (if(hour('*')=16) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_17','*+1h') else (if(hour('*')=17) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_18','*+1h') else (if(hour('*')=18) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_19','*+1h') else (if(hour('*')=19) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_20','*+1h') else (if(hour('*')=20) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_21','*+1h') else (if(hour('*')=21) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_22','*+1h') else (if(hour('*')=22) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_23','*+1h') else (if(hour('*')=23) then tagval('MY.SEA.45DAILY_PROD.ACCUMULATED_24','*+1h') else (0))))))))))))))))))))))))

                         

                         

                        Best Regards,

                         

                        Muthulingam Ramiah