I'm currently using QuickOPC library from OPC Labs. My current purpose is to write a .NET Console App to read item values from a Matrikon Simulation OPC server.
The simulation server is running on a remote machine with IP address available, and I need to enter username and password to login to this remote machine.
My current code is as follows:
NetworkSecurity networkSecurity = new NetworkSecurity(UserName, Password, MachineName);
ServerDescriptor serverDescriptor = new ServerDescriptor("\\\\xxx.xxx.xxx.xxx\\Matrikon.OPC.Simulation.1", networkSecurity);
serverDescriptor.Scheme = "opcda";
DAItemDescriptor itemDescriptor = new DAItemDescriptor(ItemID);
Console.WriteLine(client.ReadItemValue(serverDescriptor, itemDescriptor));
The exception is as follows:
Exception: An OPC operation failure with error code -1073442759 (0xC0049039) occ urred, originating from 'OpcLabs.EasyOpcRaw.DataAccess.RawEasyDAClient'. The inn er exception contains details about the problem. Inner Exception: No method available to convert ProgID to CLSID.
If I try to use CLSID
ServerDescriptor("\\\\xxx.xxx.xxx.xxx\\{F8582CF2-88FB-11D0-B850-00C0F0104305}", networkSecurity);
The exception becomes:
Exception: An OPC operation failure with error code -2147024891 (0x80070005) occ urred, originating from 'OpcLabs.EasyOpcRaw.DataAccess.RawEasyDAClient'. The inn er exception contains details about the problem. Inner Exception: Access is denied.