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.

"SubscribeDataChange" using the read function

More
10 Feb 2020 14:18 - 10 Feb 2020 14:19 #8215 by support
You still do not understand. I will try again.

There is no way to make OPC UA Read without specifying some MaxAge value (special for value cache or device, or some concrete number of milliseconds). This refers to what happens "on the wire".

QuickOPC has various various methods that, in the end, call the OPC UA Read service. Some of them allow you to specify the maximum age, some of them don't (and they use some default) - but even if there is no maximum age in the QuickOPC method, this does not mean that there is none being used on the wire. When there is no maximum age in the QuickOPC method call, a default is used; the default is Int32.MaxValue, which denotes a "cache" read.

In QuickOPC, for a particular OPC UA service, there is always on "universal" method that allows you to pass in everything possible, and also get back the maximum from what the OPC UA service call actually provides. For the OPC UA "Read" service, this "all-capable" QuickOPC method is ReadMultiple.

In addition to the "all-capable" method, there may be some additional methods that build on top of it, and make it easier to call it in some common cases. In .NET, there are literally tens of overloads for the methods, allowing various combinations of arguments. In COM (which has to be used to interface from .NET to Delphi), multiple overloads with the same name are not possible, and the number of these "extra" methods is smaller.

The "Read" method is one of the additional methods. It just puts together arguments for ReadMultiple, then calls ReadMultiple with one argument in the array, then extracts the single result it returns. No magic.

So, if you want to read one node in Delphi, and want to pass in a maximum age, you will simply use ReadMultiple instead, give it the array of arguments with one element (and the proper maximum age), and you are done.

Regards.
Last edit: 10 Feb 2020 14:19 by support.

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

More
10 Feb 2020 13:21 #8214 by Moien
Yeah by simple read I meant reading just one node. In the first part you mentioned that there is no way around using "MaxAge" and from the other hand you say for Reading one node for the sake of simplicity there is no "MaxAge" and we should use "ReadMultiple"! So for Reading one node (with simple read) there is a way around it but this way does not deliever the current Server Values.
I am wondering if OPCLabs is ready to do the programming for a new "Read" function (Reading from one node) which also offers MaxAge option. We are using both "ReadMultiple" and "Read" in our software and for both we need to get the current values from the server. How much effort is it to do this kind of programming?


Best regards,
Moien

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

More
10 Feb 2020 12:11 #8213 by support
Hello. I do not understand your post.

Ad 1. MaxAge value is _always_ specified by any OPC UA client to OPC UA server when a Read service is called. There is no way around it. The MaxAge can be 0 (for reads from the data source), it can be set to reads from cache, or to a any desired value in milliseconds. QuickOPC cannot be different - it always passes a MaxAge. And you can specify the maximum age in the parameters for the Read. It is up to you which value you choose. If any of the values has advantages or disadvantages for you, or does not behave as you think it should, QuickOPC has nothing to do with it - it just uses the value you specify.

To your question : "How can we improve the performance using MaxAge = 0".
This is a question for Softing.

To your question: Why doesn't the "ReadMultiple" function read directly from Server without using MaxAge?
As I explained, there is no way to read "without MaxAge" (see OPC UA Spec Part, chapter :Read Service Parameters). You can, however, use any value you like for MaxAge (including special values "device" or "cache"), and QuickOPC allows you to do so.

Ad 2. I am not sure you mean by "simple Read". Please explain. If, what you meant, was reading one node instead of multiple ones: The Read and ReadValue are simplifications to make coding easier when reading just one item. For them to remain simple, some parameters are not available. If you want to read one node and specify MaxAge, use ReadMultiple with one node.

Regards

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

More
10 Feb 2020 10:47 #8212 by Moien
Hello,

We have contacted Softing AG and they have analysed the case. They also got our example which the client from OPCLabs was used inside (Quick OPC 2019.1). After analysing the example, they figured out that the read function from (Client) OPCLabs read the values not from the OPC UA Server directly, but from the the internal Cache.
As you have suggested we have used "MaxAge = 0" with "ReadMultiple" function from OPCLabs. Now, we get the current values from the Server. But using MaxAge has a significant effect on the CPU performance (CPU performance is getting worst).
Now pop up two questions for me!
1. How can we improve the performance using MaxAge = 0? (Or Why doesn't the "ReadMultiple" function read directly from Server without using MaxAge?)
2. What is the equivalent MaxAge function for simple OPCLabs read? I did not find MaxAge for simple "Read" function and have to still use subscribe function to get the current values from the server.

Best regards,
Moien

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

More
27 Jan 2020 06:49 #8172 by Moien
I already tried this one. In fact by setting MaxAge = 0, you are definning the maximum age of the value to be read in milliseconds at zero. This age is the difference between the serverTimeStamp and the time when the OPC UA Server starts processing the request. It did not change anything,, because I think the default value is initialized by zero from the very first beginning.


Best regards,
Moien

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

More
27 Jan 2020 06:40 #8171 by support
I cannot verify the syntax at this moment, but when preparing arguments for ReadMultiple or ReadMultipleValues methods, you would add something like
ReadArguments1.ReadParameters.MaximumAge := 0;
Best regards

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

More
27 Jan 2020 05:44 #8170 by Moien
Hi,

No they did not tell anything about reading from Cache.

But what do you mean by changing the read parameter and reading from the device?


Best regards,
Moien

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

More
26 Jan 2020 20:23 #8169 by support
Hello,

one more thing: Didn't that say something about reading from Cache?
If their bug is in the fact that the cache is never updated unless there is a subscription, then you could change the Read parameters in QuickOPC e.g. to read from the Device.

Kind regards

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

More
22 Jan 2020 17:08 #8164 by support
Hello,

thank you for letting me know.

Kind regards

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

More
22 Jan 2020 13:41 #8162 by Moien
Hello,

I would like to thank you for your priceless effort.
I already contacted softing a couple of days ago, because it was also one of my assuptions as the source of this problem (after the test I have done on .NET Demo Server). Now we came into a solid response regarding the source of the problem. They (Softing AG) wrote me today and told me that there are some bugs in dataFEED Suite which leads to this problem. In other words, softing does not work properly with OPCLabs and we should wait for the new update from Softing.

Again thank you for your time and effort.


Best regards,
Moien

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

Moderators: support
Time to create page: 0.080 seconds