AnsweredAssumed Answered

How to connect to PIServer programatically?

Question asked by ztluw on May 5, 2015
Latest reply on Apr 27, 2016 by Marcos Vainer Loeff

My first steps accessing PI Server programatically...


wrote this little class:


   public class PIConnector : IPIConnector
      private PIServers _piServers;
      private PIServer _piServer;

      public PIConnector(string ServerName)
         _piServers = new PIServers();
         if (!_piServers.Contains(ServerName))
            throw new ArgumentException("Unknown server specified!");
         _piServer = _piServers.First(s => s.Name == ServerName);

      public void Connect()

      public void Disconnect()

      public bool IsConnected()
         return _piServer.ConnectionInfo.IsConnected;


When I use it in a little test program it always says:


Connection to pinetmgr lost


If I pause the execution or after a timeout, I can see it stays at the Connect() call.

It says unhandled exception of type SEHException occured in AFSDK.dll.


Has anybody an idea what is going wrong?

How would you create a connection?


Thanks for any hint...!