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.

Using KEPServerEx Sim Driver && Getting dropped subscriptions

More
24 Mar 2015 12:57 #3000 by sun21
@support:

I have similar problem: periodically (several times / hour) failed subscription when just one tag is subscribed with a rate = 100ms. Sometimes all 1700 tag failed, sometimes 1 tag only.

My setup:
QuickOPC-UA client (v5.32) subscribed to Kepserver with ~1700 tags with total update rate ~100Hz
All tags subscribed with 200ms rate, except of one tag with 100ms. The tags are updated 4 times/s maximum (250ms).

What I can do to avoid this problem?

This post is related to this sentence: support said: "The second keep-alive mechanism is on the Subscription (=lower) level, and it is this one that can trigger the "publishing stopped" error. With some simplification, it is raised when the client sees no notification from the server for the specific subscription for a keep alive interval, which is computed as the publishing interval of the subscription times the keep-alive count. Both these are given to the server by the client, but can be revised on the server side. Currently we pass in the default keep-alive count of 10 to the server, and this cannot be changed from your code.")

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

More
21 Mar 2015 19:53 #2972 by support
Actually, both of these are explainable.

In my reply (in this forum thread) from 03 Mar 2015 14:45, I explained that there are two keep-alive mechanisms. Currently we are only trying to turn off one of them when we detect a debugger. I have made a note to address this, and add a similar handling for the second keep-alive mechanism in a future QuickOPC version.

And, your observation about a possible contention when accessing the server from the event handler is right. In principle some of this contention cannot be removed, therefore (until/if we decide to actually handle it for you and queue the events and call the handler from a separate worker thread) your idea to work around it is correct in principle.

Note, however, that Task Parallel Library (TPL), and thus Task.Run, is quite unpredictable in when it will run the task. This is OK for some application, but possibly a very unpleasant surprise in others. For example, we have seen it wait with execution and "stack" the work for extended periods of time, when it has observed certain pattern of incoming requests. It fully follows its "contract", i.e. in the end it *does* execute the task, but beside it, no assumptions about the timing should be made. Other means of doing it (e.g. plain .NET threads) are of course still non-deterministic due to the nature of Windows scheduling, but still far better predictable. Just a hint...

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

More
12 Mar 2015 14:52 #2955 by Bmello4688
Update I have added a Task.Run when the monitor item changed event is thrown in order to relieve any dependency the easyUAClient. The subscription drops are now happening infrequently. Now only time I am getting subscription drops is when I am debugging. This could be due to Keep-Alive, but I thought your client determines if we are debugging and then maxes out KeepAlive. I have also changed the FastestPublishingTimeInterval to 1, but I am not actually sure if this is helping since my publishing setting is defaulted to 0.

Something I have noticed:

If I get a monitored item changed event, do not run on a background thread, and try to make calls to the server, I tend to get subscription drops. I wonder in this case if there is contention over a certain resource that is causing the problem.

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

More
09 Mar 2015 13:31 - 09 Mar 2015 13:32 #2952 by Bmello4688
Ok it appears that the new QuickOPC 5.32 does not have the correct OPC UA SDK redistribution package. How do I get my hands on the latest package?
Last edit: 09 Mar 2015 13:32 by Bmello4688.

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

More
06 Mar 2015 07:04 #2939 by support
If the error you are getting is still the same (indicating a problem with the "hashsize" argument for the certificate generator), then I still believe the cause must be a mismatch in the versions.

When we install fresh QuickOPC 5.32 (note that the version is relevant here - I understand that 5.32 is what you are using now), there is a file Opc.Ua.CertificateGenerator.exe under a folder similar to "C:\Program Files\Common Files\OPC Foundation\UA\v1.0\Bin" (it will be "Program Files (x86)" on 64-bit systems. The file must be precisely 1,149,760 bytes long, and I am attaching it (zipped) to this post, for convenience.

File Attachment:

File Name: Opc.Ua.Cer...ator.zip
File Size:473 KB


The issue is not really related to certificate verification or trusting that you mentioned. I do not fully understand what you mean by:

Ok is there a way to autotrust anycert that is generated.

I do not want my application failing because of the certificate not being confirmed as trusted.


The certificate being generated on the client side is presented to the server, and verified there. If you want that the servers trust it, or that it trust any client certificate, you need to arrange it on the server side, for which please refer to the server documentation or seek help with the server vendor.

In the opposite direction, there is a verification of the server certificate on the client side. If you want your client to trust any server certificate, set AcceptAnyCertificate to 'true' in CertificateAcceptancePolicy, which for the EasyUAClient-s with Isolated = false (the default) is taken form the static EasyUAClient.AdaptablePArameters, whereas for EasyUAClient-s with Isolated = false it is taken from their instance's IsolatedParameters.

Turning off the certificate checks, be it on server or client side, is meant for testing purposes only. It invalidates much of the OPC UA security. I recommend against using it, outside of test environment.

Best regards
Attachments:

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

More
05 Mar 2015 20:59 - 05 Mar 2015 21:21 #2937 by Bmello4688
Ok is there a way to autotrust anycert that is generated. I do not want my application failing because of the certificate not being confirmed as trusted.

I have uninstalled and reinstalled all redist packages. I am still getting the exception. Even when running the EasyUADemo app.
Last edit: 05 Mar 2015 21:21 by Bmello4688.

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

More
05 Mar 2015 20:31 #2936 by support
The certificate is always generated, even with security turned off. This behavior is by design (and for a reason).

The error occurs because an improper version of UA certificate generator exists where the component is looking for it. Try reinstalling the "OPC UA Local Discovery Server 1.02" from the Redist folder in QuickOPC installation directory.

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

More
05 Mar 2015 20:04 #2935 by Bmello4688
With the upgrade to 5.32 I am having issues creating a connection. It looks like the easyUAClient is trying to generate a certificate even though I have security shutoff. Since I am not logged on an admin account the easyUAClient throws an exception

OPC-UA service result - Could not create a certificate via a proxy: -error Unprocessed arguments exist possible syntax error: -hashsize.
StatusCode: {Bad} = 0x80000000

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

More
05 Mar 2015 14:48 #2934 by support
On a relation between debugging, and slow-down with large number of exceptions or IntelliTrace, an interesting article: blogs.msdn.com/b/visualstudioalm/archive/2015/03/03/make-deb...faster-with-visual-studio.aspx .

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

More
05 Mar 2015 09:45 #2915 by support
Right now I cannot think of other legitimate reasons for BadSessionIdInvalid. It could be consequently related to the "publishing stopped" - i.e. the publishing stops first, then the session closing process is invoked. But I cannot be sure.

It may be worth to make another Wireshark capture with this issue, at this point.

I have to apologize in advance - between May 8 and May 20 I will be out of office with very limited access (and unfortunately there isn't another person to do this level of support).

Best regards

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

Moderators: support
Time to create page: 0.082 seconds