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...