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.

Switching OPC servers upon failure

More
07 Mar 2015 09:28 #2947 by support
I think there are 3 things to discuss here:

1. How to recognize that a server is unavailable (or available again).

This isn't fully in aligned with QuickOPC model, because what we are trying to do is to hide the existence of connections to the server, and expose only the OPC items as the entity you work with, and has status. For example, if the connection to the server is broken, we generate an error, and multiplicate it and send notifications for each and every item affected - but there is nothing for the server itself.

There are several options here. For start, can't you subscribe to some kind of status item in the server (some that resides directly in the server and does not need a communication to any downstream devices), and interpret it as an indication of the connection status? If you receive an ItemChanged notification for this item with .Exception != null, it would mean the server is unavailable, and vice versa.

2. What to do when it happens (a server becomes unavailable, or available again).

First, although I know it's probably not the solution, remember that in theory you can stay subscribed to both the primary and secondary server all the time, and just take the valid data and throw away the errors from the unavailable server. QuickOPC will take care of re-connecting to the failed server after a configurable period, be it the primary or secondary one.

If the above is not an option, and you want to truly switch the servers, then you will need to unsubscribe from all items referring to the current server, and subscribe again to the same items, but in a new server.

3. How to do it.

This is just an implementation exercise - making sure you, as you pointed out, that you subscribe again with proper machine name in the arguments. Nice thing here is, if you use the State parameter/property to identify the items with something of a meaning of your app (and then interpret the State in the event handler), the State can stay the same between the primary/secondary server subscriptions, and the event handler for the ItemChanged events will stay without a coding change - the incoming events will look the same (have the same State value), no matter where the item comes from.

I hope this helps. Please be patient with our replies in coming two weeks - see the notice above the forums.

Best regards

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

More
06 Mar 2015 17:29 #2944 by Flintstone
In our facility, we have a primary server and a redundant server for each of our process control systems. Both the primary and redundant servers are identical and each is updated any time there is a program change. (This is handled by the process control software.) Both the primary and redundant servers have identical OPC servers (except, of course the server name) and the system is configured to automatically switch from the primary server to the redundant server if something goes wrong with the primary server.

The problem that I have is that all of the programs that I have written using the OPC Labs software (most of them use the EasyDAClient and subscribe to multiple items) continue to “look” at the primary server even after the system has detected a problem and switched the clients over to update from the redundant server. Can you give me any guidance or point me to documentation that tells how I determine when the primary server is unavailable and switch my subscriptions to the redundant server? All parameters of the DAItemGroupArguments will remain the same between the two servers with the exception of the "machineName."

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

Moderators: support
Time to create page: 0.050 seconds