I'm trying to connect a remote simulation server with an 64-bit based console app. My current code is as follows:
EasyDAClient client = new EasyDAClient();
Console.WriteLine("Reading item test...");
EasyDAClient.SharedParameters.ClientParameters.UseCustomSecurity = true;
NetworkSecurity networkSecurity = new NetworkSecurity(UserName, Password, MachineName);
ServerDescriptor serverDescriptor = new ServerDescriptor("\\\\xxx.xxx.xxx.xxx\\Matrikon.OPC.Simulation.1", networkSecurity);
serverDescriptor.Scheme = "http"; // this does not work no matter what scheme I tried
DAItemDescriptor itemDescriptor = new DAItemDescriptor();
Console.WriteLine(client.ReadItemValue(serverDescriptor, itemDescriptor));
(UserName, Password, MachineName) are constants where "MachineName" is exactly same as "xxx.xxx.xxx.xxx" specified in constructor of server descriptor.
There are 6 inner exceptions shown as follows:
1/6
NetApiException: An exception occurred during processing in a NET API OPC Data Access client. The inner exception contains details about the problem.
2/6
NetApiException: An exception occurred during processing in a NET API OPC Data Access client. The inner exception contains details about the problem.
3/6
ResultIDException: E_FAIL
E_NETWORK_ERROR
Could not connect to server.
4/6
ConnectFailedException: E_NETWORK_ERROR
Could not connect to server.
5/6
WebException: Unable to connect to the remote server
6/6
SocketException: No connection could be made because the target machine actively refused it
I also tried other scheme such as "opc.tcp" and without scheme (this seems to be automatically recognized as "file" scheme), none of them works.
Any help will be appreciated.