Professional OPC
Development Tools

logos

Application Disconnects and Reconnects on Remote Connections

More
04 Dec 2018 16:51 #6885 by gkalipershad

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

More
04 Dec 2018 16:41 #6884 by support
Thanks for letting me know!

Note that we have kind of "hidden" the problem that may still exist between QuickOPC and the Beckhoff, when multiple connections are made (by using a single connection, which is better anyway - but using more shouldn't be problem too).

Try to keep it in mind if something similar pops up in the future.

Best regards
ZZ

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

More
04 Dec 2018 16:38 #6882 by gkalipershad
Z,

The customer implemented your last suggestion and has reported back that OPC counts are not increasing and there is currently no hanging issue. Looks like they are out of the woods, but I will let you know if there are any setbacks.

Thanks for your help on this.

GK

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

More
20 Nov 2018 09:48 #6872 by support
Ganesh,

yes indeed, the Live Binding basically has its own EasyUAClient object, so when combined with "traditional" coding and "new EasyUAClient()" (even if it is with Isolated = False), it will end up using separate session.

And, we can see that this is somehow problematic with the target OPC server (Beckhoff).

So, the customer can remove the Live Binding - but that's not really necessary. Here is an alternative: He can keep the Live Binding and also his own code, BUT he nends to refrain from allocating new EasyUAClient objects. Instead, he should use the same object that Live Binding is using. He can access that object by calling the GetClient() method on the DAConnectivity component he already has (for the Live Binding). This will return an IEasyUAClient interface which can be used to perform all necessary operations.

I suggest that the customer does this, then re-test, and with the results we will go forward.

Best regards

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

More
19 Nov 2018 21:29 #6871 by gkalipershad
Z,

The customer confirmed that this is a Winform application. He stated that they are using Live Binding and two instances of the EasyUAClient object; however, these are set to Isolated = False. Would it be possible that the combination of Live Binding and the client object is causing multiple sessions to be created? The customer indicated that he plans to to move back to Live Binding completely, which he was doing before, or completely remove it in favor of the EasyUAClient object.

For the implementation of the endpoint URL, he has that set to a form property and references that property.

He also acknowledged the observation that the server does not decrease the session/subscription/monitored items counts on its own and will report this to Beckhoff.

Lastly, I received a zipped file with the complete project. I will be sending this to you directly.

Thanks,
GK

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

More
15 Nov 2018 09:09 #6861 by support
To the Visual Studio hangs: Unfortunately, it is going to be hard, because here I miss the means to obtain more information about what is happening.

Is the customer using Live Binding in WPF or Windows Forms? (I think it is WPF, but need to verify that).

Regards

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

More
15 Nov 2018 08:48 #6860 by support
This is a reply to the "Issue #1" from the PDF - that is, the increasing session/subscription/monitored item counts in the server. Yes, as the customer has already figured out, the connection appears to "break" from time to time, and that causes the counts to increase. According to the WireShark trace, however, the servers "knows" about the problems (it sends ServiceFault messages, e.g. in packet #1716), and therefore it should, either immediately or at some later time, decrease the counts. The fact that it does not do it should be reported to Beckhoff, but that's not the main issue here.

The question is, what is causing the disconnections in the first place. I do not know yet. Basically, the server seems to stop sending publish responses for quite a time, and then starts sending the ServiceFault messages. I suspect this may be a server problem and can provide more detailed analysis with references to the Wireshark trace, but there is one more thing going on which I do not understand, and that can be related, and I want to clarify it before we blame the server. It is the fact that for some reason, QuickOPC starts with one session to the server, but after cca 6 seconds, it creates a second one - and it is roughly at this time when the first session starts having problems. I do not understand why this second session is being created.

Explanation might be e.g. that either 1) the customer has used EasyUAClient with setting Isolated = true, or 2) he is using two, functionally equivalent but still different ways to address the server. Can you please ask the customer whether he is absolutely sure that he always uses the same endpoint URL string in his program? Including upper/lowercase, and seemingly unimportant things like the slash at the end? For example, is he always stating the host name as "CONVBELT", and not sometimes as "convbelt"?

If the answers to the above questions are negative, I would like to ask the customer to collect yet more information. I will provide the necessary instructions in such case.

Regards

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

More
15 Nov 2018 08:24 #6859 by support
Ganesh,
thanks for all the info.

I will start with what is labeled as "Issue #2" in the PDF - that is, the UAException with service result 'BadSessionIdInvalid'. First, I contest the claim that try-catch does catch the exception. Please have the client send the related part of the code for review. Actually, ideally all the code (could be through a private channel, not here), because there might be other place in the code where it is coming from and does not have the try-catch.

As to the exception itself, I think it is very likely that it is related to debugging, as he suggested. There is a session timeout which defaults to 1 minute. Blocking the client process (by breaking into a debugger and then pondering about the status) for a longer period can cause the server to discard the session, which would result precisely in this status code. If this is seen as a problem, the customer can increase the session timeout by setting a property - see opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User's...Parameters~SessionTimeout.html .

For a bunch of subscription-related parameters, we already have special handling in the code so that we set these parameters to much longer values when a debugger is detected. But we do not currently do this with the session timeout. I have made a note to possibly improve it in the future.

The remaining issues will be addressed in separate posts.

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

More
14 Nov 2018 22:24 #6857 by gkalipershad
Hey Z,

I have a customer with the following system:

Windows 7/32bit
Visual Studio 2017 Professional
Version 11.0.61219.00 Update 5
Software Toolbox OPC Data Client 2018.3
Target Framework 4.6.2

He has an OPC UA application that is subscribing to tags using EasyUAClient objects and Live Binding. He also writes new values to tags based on the result of some reads. He is having several issues that I was hoping you could help with. The first is that Visual Studio will hang sometimes when he compiles or starts the application. He is able to kill the process, restart and continue working. The errors that are thrown are shown in the attachment STBOX.pdf. He mentioned that when he removes the Data Client components, this does not occur, but once he re-adds an EasyUAClient object, the hangs come back.

The second issue is that the application will randomly request to disconnect from the server and then reconnect. Details on this issue is also included in the pdf attachment and there is a Wireshark capture of this behavior.

The third issue is an unhandled exception. The error may just not be handled correctly in the code. Again, there are details in the pdf.

Upgrading to VS2017 and Version 2018.3 were done in an attempt to remedy this behavior. Please let me know if you think there is anything we can do about these issues. If you need clarification on anything, please let me know.

Thanks,
GK
Attachments:

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

Moderators: support
Time to create page: 0.208 seconds

      

 Recommend this on Google