konimarti / opc

OPC DA client in Golang for monitoring and analyzing process data based on Windows COM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timeout setting?

AlexanderMatveev opened this issue · comments

I'm connecting to remote OPC and looks like something is closing connection by timeout after 40 seconds:

OPC 2019/09/14 23:42:27 Could not load OPC Automation object with wrapper OPC.Automation.1
OPC 2019/09/14 23:42:28 Loaded OPC Automation object with wrapper Graybox.OPC.DAWrapper.1
OPC 2019/09/14 23:42:28 Connecting to XXXXXXXX.FSGateway.1 on node 1xx.xxx.xxx.xxx
OPC 2019/09/14 23:43:10 Connection failed.
panic: TryConnect was not successful: Connection failed

OPC by itself is fine, I successfully connecting to it using OPC Expert tool.

So give me an advice please, is it possible somehow to manipulate timeout?

As explained in the README, this package uses OPC Automation Wrappers to access OPC servers (automation wrappers contain the actual code for connecting to an OPC server and reading and writing data, see here). Your OPC Expert tool doesn't use the automation wrapper.

You need to make sure that the correct OPC automation wrapper is installed on the machine where you run the code and that it is compatible with your OPC server.

The standard OPC DA automation wrapper is usually installed when you install your OPC server (make sure to select the OPC Core Components when you have a choice). I can see from your debug output that the standard OPC wrapper (OPC.Automation.1) is not installed and you are using the Graybox wrapper.

So my recommendation would be to install the OPC server also on the machine where you run the code and get the OPC DA automation wrapper (OPCDAAuto.dll). I hope this makes sense. If you have further questions regarding the automation wrappers, please look into the link above.

Closes 01ef7ad