Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

confirming that the connection to an OPC server is valid and live

More
10 Mar 2012 10:49 #793 by support
Hello.
The short answer is: You do not have to do anything - the component takes care of it.
The detailed answer is:
In OPC Data Access 1.0 and 2.0, this is achieved by calling the OPC function IOPCServer::GetStatus. In OPC Data Access 3.0 (only supported by some servers), there is also a KeepAlive functionality: The server must report back to the client (by a callback) in certain time, periodically. In addition, the "dead" connection can also be detected when certain system-level errors are returned from other calls to the OPC server. Our component uses all available methods to check that the connection is live. For example, we call IOPCServer::GetStatus periodically (each 15 seconds by default), and verify that both the function has properly reached the server and returned, but also that the server (if reachable) itself is not reporting problems in the output arguments of that function.
If a problem is detected, the component disconnects from the OPC server.
After a server is disconnected in an unwanted way, our component reconnects - but not immediately, but after a delay. The delay depends on the kind of problem detected, and there are currently three of them:

ServerFailedReconnectDelay (defaults to 1 minute) - when the OPC Server indicates through OPC functions that it has failed.
ServerShutdownReconnectDelay (defaults to 1 minute) - when the OPC Server wants to shutdown and has asked its OPC clients to disconnect.
ClientReconnectDelay (defaults to 1 minute) - in all other cases, when the connection is detected "dead".

So, in default configuration, if the OPC server is live again, after 1 minute, you will get your live data back. The delays are configurable via properties on the object.
There is no separate event that indicates such problems. Instead, when the server is detected "dead", all method calls that reference such server will return an exception. Also, all subscribed items will receive an event notification (ItemChanged) where the Exception property is non-null and contains the error information. When the re-connection succeeds, method calls referencing the server will start succeeding, and all subscribed items will receive recent valid data through their normal even notification (ItemChanged).
We have different error codes for different kinds of problems.

Please Log in or Create an account to join the conversation.

More
10 Mar 2012 09:33 #792 by support

Zbynek

What is the best way of confirming that the connection to an OPC server is valid and live? Do OPC servers have a tick or heartbeat that I could monitor?
Regards

P.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.045 seconds