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.

Reading already subscribed item causes troubles with State

More
04 Jul 2024 17:49 #12917 by KrisSik
Hi,

Thank you for quick fix, it works great now.

Best regards,
Kristian
The following user(s) said Thank You: support

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

More
04 Jul 2024 11:13 - 04 Jul 2024 17:55 #12915 by support
Hello.
The problem is now fixed, in QuickOPC 5.80.274, which is now on our Web site (Downloads) and www.nuget.org.

Thank you again for reporting it.
Best regards
Last edit: 04 Jul 2024 17:55 by support.
The following user(s) said Thank You: KrisSik

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

More
04 Jul 2024 08:30 #12914 by support
Perfect, thank you, I was able to reproduce the problem. Good catch!

As it turns out, it is a bug in the Item Caching optimization. Essentially, when you do Read, and there is a value from Subscription notification that is of the good age, it is provided to you instead, bypassing the actual OPC Read. You get the VtqResult from the subscription, but of course the State should have been replaced by the one that you specified for Read - which is not happening.

There is a workaround - turn off the Item Caching optimization. See here: opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Late...html#OPC%20DA%20Optimizer.html , i.e. in your case:

            DAOptimizerPluginParameters? optimizerPluginParameters =
                opcClient.InstanceParameters.PluginConfigurations.Find<DAOptimizerPluginParameters>();
            if (!(optimizerPluginParameters is null))
                optimizerPluginParameters.EnableItemCaching = false;
Stay tuned, the true fix should come soon. I will post here when it is ready,

Best regards
The following user(s) said Thank You: KrisSik

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

More
03 Jul 2024 08:46 #12902 by KrisSik
I prepared a simple code example that demonstrates the issue. Please find that in the attachments.

File Attachment:

File Name: QuickOpcExample.zip
File Size:1 KB
Attachments:

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

More
03 Jul 2024 07:35 #12901 by support
Thank you.

Is this something for which you can provide a code that shows the problem, with some OPC DA server accessible to us?
I can try to write the code and reproduce, but there is a danger that it won't show up.

Regards

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

More
03 Jul 2024 07:30 #12900 by KrisSik
Thank you for the response,

Unfortunately, using OpcLabs.QuickOpc 5.80.255 does not solve the problem.

Kind regards,
Kristian

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

More
03 Jul 2024 07:14 #12899 by support
Hello,
I agree this looks like a bug.

However, you are using an older version. First thing to do is to try to reproduce with the current QuickOPC version. If it remains a problem, we will investigate.

Best regards

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

More
03 Jul 2024 07:09 #12898 by KrisSik
Hi,

I am communicating with OPC DA server using OpcLabs.QuickOpc 5.63.246 (.net6.0). In my application I perform subscription to the item A at startup, and in some cases I need to read the value of item A using EasyDAClient.ReadMultipleItems(DAReadItemArguments[] argumentsArray). Data source is ByValueAge and ValueAge is 1 sec.

Both for subscription and for reading I use State and operate with that when I get the response from OPC DA server. In most cases I perform read operation after the value changes, so it happens after I get subscription notification (< ValueAge). The problem is, in this situation State contains wrong object. Instead of State I specified in the DAReadItemArguments before reading using EasyDAClient.ReadMultipleItems(DAReadItemArguments[] argumentsArray), I receive object of type OpcLabs.EasyOpc.DataAccess.Implementation.DelegatingEasyDAClient+DelegationRecord, which is impossible to operate with.
Specifying ValueAge = 0 sec fixes the issue, but this is not expected behavior and seems to be bug.

Best regards,
Kristian

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

Moderators: support
Time to create page: 0.060 seconds