1 Reply Latest reply on Apr 23, 2013 10:56 PM by fzhang

    PI ACE Calculation


      Hi There,
             I have a calculation in PIPE  and wish to move it to PI Ace , see below for calculation,  is there a better way to do it please help


      Event=650YX1_ESP , PrevVal('650YX1_ESP')+PrevVal('650YX1_ESP',(PrevEvent('650YX1_ESP')))+ PrevVal ('650YX1_ESP', (PrevEvent('650YX1_ESP', PrevEvent('650YX1_ESP')))) +PrevVal('650YX1_ESP',(PrevEvent('650YX1_ESP', PrevEvent('650YX1_ESP',PrevEvent('650YX1_ESP'))))) + PrevVal('650YX1_ESP',(PrevEvent('650YX1_ESP', PrevEvent('650YX1_ESP',PrevEvent('650YX1_ESP', PrevEvent('650YX1_ESP'))))))

        • Re: PI ACE Calculation

          You can essentially do the same thing in PI ACE using the PIACEPoint class's PrevVal and PrevEvent methods. For more information on the PIACEPoint class, see the PIPC\ACE\Help\PIACEReference.chm help file.


          For it to be an event based calculation, register it as Natural instead of Clock and select the trigger tag.




          A quick example:


          Imports OSIsoft.PI.ACE


          Public Class Partab


             Inherits PIACENetClassModule


             Private sinusoid As PIACEPoint


             Private result As PIACEPoint




             '      Tag Name/VB Variable Name Correspondence Table


             ' Tag Name                                VB Variable Name


             ' ------------------------------------------------------------


          ' result                                  result


          ' sinusoid                                sinusoid




             Public Overrides Sub ACECalculations()


                 result.Value = sinusoid.PrevVal(sinusoid.PrevEvent())


             End Sub


             Protected Overrides Sub InitializePIACEPoints()


          result = GetPIACEPoint("result")


          sinusoid = GetPIACEPoint("sinusoid")


             End Sub




             ' User-written module dependent initialization code




             Protected Overrides Sub ModuleDependentInitialization()


             End Sub




             ' User-written module dependent termination code




             Protected Overrides Sub ModuleDependentTermination()


             End Sub


          End Class