mrai

PISDK Error: The server is already open under a different connection string

Discussion created by mrai on Jan 3, 2011
Latest reply on May 15, 2011 by IOMHouston

Hi All,

 

We have an issue with the PI SDK that we tried to resolve via Tech Support. After spending a couple of days with Tech support, we were asked to post this to the vCampus folks. So here's the issue:

 

We have developed an ASP.NET web application which basically has custom reports that query data from our PI Collective (2 members). Our application uses PI SDK (v1.3.8.388) to query tag data. We have the following method in .NET (which is used by our ASP.NET web application) which returns a PI Server object when our web page tries to query PI data. 

 

public Server GetServer(string piuser, string pipassword)

 

{

 

      // We get the piuser and pipassword based on which Active Directiry group a user belongs

 

      // Using the above user account, we connect to PI via PISDK

 

 

 

      PISDKClass sdk = new PISDKClass();

 

      Server server = sdk.Servers[ConfigurationManager.AppSettings["PIServer"]];

 

      server.Open(string.Format("uid={0};pwd={1}", piuser, pipassword));

 

      return server;

 

}

 

 

 

NOTE: We did not close the server connection after usage. We encountered some errors by forcefully closing the connection. At that time, we worked with some folks in the vCampus. They recommended that we don't have to explicitly close the server connection, once its open. We were also told that the PI SDK will manage this efficiently.

 

 

Outcomes