3 Replies Latest reply on May 10, 2010 4:57 PM by rhar33

    PE to ACE


      I have a PE tag that I want to move to ACE to take advantage of Clock Scheduling. When I move it into VB (I'm using Visual Studio 2005) I get an error "Expression Expected" From what I can see I have an expression. Does it not see the PrevValue function that I used in the PE equation. Probably something pretty simple, any help would be appreciated.



      Public Overrides Sub ACECalculations()
        NR_Unit_1_Mwh_Out_Hourly.Value =   IF NR Unit_1_Mwh_Out.value < PrevVal(NR_Unit_1_Mwh_Out.value,*-1h) 
        THEN NR_Unit_1_Mwh_Out.value - PrevVal(NR_Unit_1_Mwh_Out.value, *-1h)+ 1000000 
        ELSE  NR_Unit_1_Mwh_Out.value - PrevVal(NR_Unit_1_Mwh_Out.value, *-1h)
      End Sub

      Thanks, Ron



        • Re: PE to ACE
          Asle Frantzen

          Hi there Ron


          First I just want to say that clock scheduling can easily be done with a Performance Equation. In fact, it's as common as using another tag to schedule by. Read the manual to find out how (hint: search for how to define a scan class)!




          Secondly, it appears you've just pasted the PE itself directly into the ACECalculations() method. This cannot be done, you'll have to use the Visual Basic programming language, and you'll also have to use the ACE Wizard to create your ACE project and define the output tag. I'll invite you to read the manual for that as well, or download some class materials from an ACE programming course (from the techsupport pages).


          Based on your requirements here, I think you'll be better off with just keeping the Performance Equation tag (first option) and add a scan class which suits your needs.

          • Re: PE to ACE
            Asle Frantzen

            More specifically, go to the vCampus Library, find the vCampus PI Products Kit, and then Server Products. Here you can either view the PI ACE Manual (complete with step-by-step tutorial) or you can select the category PI Server. Here you'll find the PI Server Applications User Guide - and under Chapter 2 you'll find the details for the PI Performance Equation Scheduler - and how to create a PE and define a scan class to fit your needs.

              • Re: PE to ACE

                Thanks for the advice! I'm going to go ahead and build this in ACE because we will have many tags and I would like the calculations to be done separately from our PI server. I will look into the Scan Class settings for some of our other tags. The below code works well. A cup of coffee cleared the cob webs! Thanks, Ron

                Public Overrides SubACECalculations()
                If NR_Unit_1_MWh_Out.Value < NR_Unit_1_MWh_Out.PrevVal("*-1h") Then
                NR_Unit_1_Mwh_Out_Hourly.Value = (NR_Unit_1_MWh_Out.Value - NR_Unit_1_MWh_Out.PrevVal("*-1h")) + 1000000
                Else : NR_Unit_1_Mwh_Out_Hourly.Value = NR_Unit_1_MWh_Out.Value - NR_Unit_1_MWh_Out.PrevVal("*-1h")
                End If