2 Replies Latest reply on Jun 25, 2013 3:22 PM by Marcos Vainer Loeff

    Use Function Values in PI ACE Calculation

    drausim127@spiratec

      Hello,

       

      I'm just writing a little ACE-Calculation were I want to analyze the archive values of an input tag like cdt158. For this I have seen that a function Values is available but I'm not able to use it.

       

      My development system is PI Server 2010 and PI SDK 1.4.2.455. Dot Net version is 4.0 (for this I have created a file with name "PIACECLassLibraryHost.exe.config") When I write the following code I always get two error message:
      1.) Type 'PISDK.PIValues' is not defined
      2.) Reference required to assembly 'OSIsoft.PISDK, Version=1.3.0.0, Culture=neutral, PublicKeyToken=c3309f0734ba2805' containing the type 'PISDK.PIValues'. Add one to your project.

       

      Public Overrides Sub ACECalculations()
         Dim values As PISDK.PIValues
         values = Me.Gen_UnitBatchActive.Values(DateTime.Now.AddDays(-7), DateTime.Now)
      End Sub

       

      I understand error message No.1. Reason was that I haven't referenced PISDK in that project. So I have added reference OSISoft.PISDK (version 1.4.0.0) from the .NET tab. After this action error message No.1 and No.2 still appears. When I double checked my references I have seen a error message for the reference OSIsoft.PISDK

       

      The location of this reference is D:\PIPC32\SDK\PublicAssemblies. I have checked the location and a library is located at this folder.

       

      Does anyone have an idea why this happens?

       

      Best regards Markus

        • Re: Use Function Values in PI ACE Calculation

          Hello Markus,

           

          Markus Drausinger

          I'm just writing a little ACE-Calculation were I want to analyze the archive values of an input tag like cdt158

           

          You usually don't need PI SDK for this purpose.

           

          Markus Drausinger

          My development system is PI Server 2010 and PI SDK 1.4.2.455. Dot Net version is 4.0 (for this I have created a file with name "PIACECLassLibraryHost.exe.config")

           

          I am not sure if this is necessary. I am always leaving these things to PI ACE Wizard.

           

          What's the Development Environment (i.e. Visual Studio 2008 Professional) you are using?

           

           

            • Re: Use Function Values in PI ACE Calculation
              Marcos Vainer Loeff

              Hello Markus,

               

              Although you need to add the .Net PISDK library which contains the collection PIValues, you don’t need to use .Net version 4.0. To troubleshoot you problem, I would first create a new project, using the original .net version which should be 2.0.

               

              You might be adding the PISDK COM reference and not the PISDK .NET reference.  If you are not sure, which one to add, my suggestion for you is to create an empty console application and add the PI SDK reference whose component name is "OSIsoft.PISDK".  Add some code to this program just to show the name of your default PI Server. Run this application and check if the console application is using the PISDK library properly. If so, do the same steps on your ACE project to add this reference.

               

              Let us know if you could solve this problem,