3 Replies Latest reply on Apr 22, 2015 10:40 PM by asorokina

    PI-API Application Error

    SPB04@PSEG.com

      Hi,

       

      I am migrating exisiting PI API based application into new machine. Installed exactly matching version PI softwares like PI SDK and P API. Registerd required OCX files.

       

      Now, while running the executable, it's throwing error while running at following line,

       

      pilg_registerapp("piapi32.dll")

       

      Error Message: Failed to register application using PI API

       

      Any help / suggestions really appreciated. Thanks.

        • Re: PI-API Application Error
          tbirky

          My initial thought is that there is a security setting missing from the application. Since we cannot be certain of this without examining it, we recommend that you continue this with OSIsoft Tech Support. They would like version numbers, logs, and probably a remote session. You can call them at 510-297-5828, or email them at tsupport@osisoft.com. Please reference this thread from PI Square when you contact them.

            • Re: PI-API Application Error
              SPB04@PSEG.com

              Hi Everyone,

               

              I found the resolution here. The code is failing at below line,

               

              lRetVal = pilg_login(Me.hWnd, strPIUID, strPISvr, strPIPwd, 1)

               

              which returns pilg_login() returned error code -3 which translates to “Specified server does not exist” message. So, I checked into the piclient.ini and pilogin.ini in both x86\PIPC\DAT and PIPC\DAT.

               

              The PI server defined as "Collective" which PI API doesn't understand as it's older technology. So, I changed it with Primary PI Server name & it works.

               

              Additional Notes:

               

              For each connection there is an optional trust setting. This can be "NONE", "FIRST", "LAST". This is used by the method pilg_login to determine what to do when connecting to the server.

              NONE -> Don't assume a trust exists; if the various login attempts fail, bring up the login dialog. If that fails then report failure. This is also the case if the PIxTrust entry is missing for a particular server.

              FIRST -> Don't bother with login attempts. Assume there is a trust and immediately add the server to the logged in server map with PIREAD access.

              LAST -> Try all the various login attempts, if they all fail, then don't bring up login dialog; instead, assume there is a trust and add the server to the logged in server map with PIREAD access.

               

              Thanks everyone for kind help.

              1 of 1 people found this helpful