How to determine what kind of OPC server and read its item

Viewed 259

I was provide a link of OPC server: http://192.168.2.5:54354 and was asked for read an Item value. I am new to OPC and I assumed that my server is OPC XML-DA but when I try the sample code, it work. But when I replace my server URL and Item name, it not work, the server address seem to be missing some part

var client = new EasyDAClient();

DAVtqResult[] vtqResults = client.ReadMultipleItems(
  new ServerDescriptor { UrlString = "http://opcxml.demo-this.com/XmlDaSampleServer/Service.asmx" },
  new DAItemDescriptor[]
 {
   "Dynamic/Analog Types/Double", 
   "Dynamic/Analog Types/Double[]", 
   "Dynamic/Analog Types/Int", 
   "SomeUnknownItem"
 });

This one work but did not work with my Server URL: http://192.168.2.5:54354 I am not sure what /XmlDaSampleServer/Service.asmx means but I am able to connect to my sever using https://www.kassl.de/opc/explorer.shtml

1 Answers

Are you sure the server is XML-DA? Very few servers use this protocol in my experience. It is usually OPC DA (OPC Classic) or OPC UA.

Is there any security on the server like username and password?

From my experience, you need to be able to establish a connection with an existing client before writing any code. There could be a network or firewall issue. It appears that the server is on your local network. Can you connect to it with the Kassl client from the same server? OPC DA relies on the COM/DCOM components for communication that tend to have many issues with remote connections and firewalls.

Try the following steps:

  1. Ping the server and make sure it replies.
  2. Install an OPC client like Kassl or Kepware on the same Windows machine as the server and see if it can connect.
  3. If it can, disable firewall, antivirus, etc. and see if you can connect remotely.
  4. Check if there are any port-forwarding that needs to be done. You may want to use Wireshark to see what is happening with the data.
Related