Professional OPC
Development Tools

logos

Restart subscription

More
16 Sep 2016 14:09 #4336 by support
Replied by support on topic Restart subscription
In QuickOPC, a call to SubscribeXXXX indicates an intent on the developer's side to subscribe *and stay subscribed*, and QuickOPC is programmed to fulfill that. That is, if there is an error that causes the subscription to fail (which can have many causes, but includes communication errors between the OPC client and the OPC server), QuickOPC should detect it, send you an error indication through the event notification, and then attempt to re-establish the subscription repeatedly, until it succeeds - or until you explicitly unsubscribe.

For software that is supposed to do HMI, logging, calculations based on incoming data and similar, this makes it very easy to write it. Just subscribe and let the component do the rest. I cannot rule out that there are some usage cases where this does not fit well - in such case I'd like to hear about them.

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

More
16 Sep 2016 13:05 #4335 by andis59
Replied by andis59 on topic Restart subscription
We are using 5.35.442.1 on one machine and 5.35.414.1 on the other.
Our license is for 5.3

So what you are saying is that I should remove the reset of the EasyUAClient. Just start the OPC communication and then let QuickOPC do it's thing!?

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

More
16 Sep 2016 11:35 #4334 by support
Replied by support on topic Restart subscription
QuickOPC is supposed to handle reconnections in case of communications problems automatically. There should be no need to write extra code for that. If you do, you are only going to make things worse, and we specifically say in our documentation that this is not the way how to use the product.

If QuickOPC is not reconnecting automatically as it should, then *that* is what we need to troubleshoot.

Which version are you using please?

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

More
16 Sep 2016 09:25 #4333 by andis59
Restart subscription was created by andis59
I have inherited an application that uses QuickOPC-UA and a MatrikonOPC UCS (Mitsubishi Plc) and we have found a problem with the communication.

The application communicates with a number of servers/clients via Tcp and the creators has found it suitable to reset ALL communication if one fails.
To reset the OPC communication they are only starting the client again
Eg
EasyUAClient = new EasyUAClient { Isolated = true };
EasyUAClient.MonitoredItemChanged += OPCClient_MonitoredItemChanged;
 
_handle = EasyUAClient.SubscribeMultipleMonitoredItems(new[] 
{
	new EasyUAMonitoredItemArguments(null, ServerEndPoint, GetNode(OPCSettings.PLCStsGrp, OPCSettings.PLCStatus), OPCSettings.OPCSubscrRefresh),
	new EasyUAMonitoredItemArguments(null, ServerEndPoint, GetNode(OPCSettings.PLCArtNrGrp, OPCSettings.PLCArtNrStr), OPCSettings.OPCSubscrRefresh),
	new EasyUAMonitoredItemArguments(null, ServerEndPoint, GetNode(OPCSettings.PLCIdxGrp, OPCSettings.PLCIdxStr), OPCSettings.OPCSubscrRefresh)
});

We are getting errors when this code runs the second time, BadShutDown is one of them.
I wonder do I need to call
EasyUAClient.UnsubscribeMultipleMonitoredItems(_handle);
before initializing the client again?

I have no way of testing this since the machine (and the plc) is located 500 Miles from me...

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

Moderators: support
Time to create page: 0.178 seconds

      

 Recommend this on Google