How to refresh data values in a OPC UA subscription?

Unified Architecture topics related to OPC UA Specification, compliant behavior and any technical issues of OPC UA, like Security, Information Model, Companion Specs DI, PLCopen, ADI, ...

Moderator: Support Team

Post Reply
dalstorp
Jr. Member
Jr. Member
Posts: 3
Joined: 23 Mar 2009, 16:21

How to refresh data values in a OPC UA subscription?

Post by dalstorp »

In classic/COM OPC you can do refresh on a Group of Items, where the server/device would resend all items in the group. I would like to do the same in OPC UA on all data values in a subscription or a group of data values in a subscription. Is this possible and how?

Lost+Found
Hero Member
Hero Member
Posts: 20
Joined: 07 Feb 2013, 11:01

Re:How to refresh data values in a OPC UA subscription?

Post by Lost+Found »

Hi,

This is an interesting topic and we had several controversal discussions about this feature in the OPC UA working group.

The simple answer is no, there is no refresh capability in OPC UA. Just use the Read service with maxAge set to a value that is higher than your sampling intervall for the monititored items.

The longer answer has different aspects:

(1) The Refresh in COM DA was misused by a lot of OPC DA clients as a poor man’s polling. We want to avoid that this happens again with OPC UA. There is a simple rule for Services in OPC UA - provide a feature in one generic way and not in several different variations. We have Read for ad hoc access to attributes and we have monitored items and data change notifications for optimized monitoring of data changes.

(2) OPC UA features like Subscription settings, Monitored Item settings, Publish, Republish and queue handling ensure that no data can be lost during communication interruption and if data is lost, the latest value is always delivered. We did several updates to Part 4 version 1.02 to handle all cases we can think about. Especially the additional chapter about reconnect handling (6.5 Re-establishing connections) was added to have one, well defined behaviour to ensure the latest value is always delivered.


Best Regards,
Matthias Damm
OPC UA working group

dalstorp
Jr. Member
Jr. Member
Posts: 3
Joined: 23 Mar 2009, 16:21

Re:How to refresh data values in a OPC UA subscription?

Post by dalstorp »

Thanks for taking you time and writing a detailed response!

I understand that refresh in OPC COM could be misused; still it's a great feature in some cases and should be part of OPC UA event if values "can't" be lost! I can't see the feature collision between read and refresh in monitored items since these are two different cases. In the first you normally only want the values at one time or seldom. In the other you want the values all the time and sometimes want to update the all values for some reason like:
- You have a customer who does not trust the "can't be lost" guarantee.
- You have lost connection with the server for a short while and marked all data values as not updated. Then the connection is restored (subscription is still valid) and you want to get all values marked as good again.
- You have disabled the subscription and marked the data values as not updated. When you enable the subscription you want to get all the latest values again.
- ...

I agree that the handling of data transmission is mayor improvement over OPC COM with both retransmissions and back pressure (tickets), ... And I'm impressed by the stability and performance of OPC UA.I will have a look on the latest documentation next week (Part 4 chapter 6.5)

Using the read service has several problems as I can see:
1) The read request needs a lot of bandwidth (actually more than the reply) and requires a lot of extra work in both the client and server compared to doing a refresh on the monitored items.
2) When you have lots of data you need to do multiple reads.
3) If the data value changes during the read you can have a race condition between the monitored item and the same item in the read response. I can't see how the maxAge parameter can guarantee that the same data value in the read response and monitor items always comes in the correct order if the value changes during the read.

dalstorp
Jr. Member
Jr. Member
Posts: 3
Joined: 23 Mar 2009, 16:21

Re:How to refresh data values in a OPC UA subscription?

Post by dalstorp »

I have looked at Part 4 chapter 6.5

I could use read to get the latest value and look at the timestamp to make sure that the read value is not older then the value received from the active notification. However this does not solve the complexity of using read and the unnecessary use of resources (CPU, memory and bandwidth)

There are two more problems using read, rather than refresh:
1) You can loss intermediate changes.
2) If the server only has a low resolution timestamp and you get a different value from read and notification with the same time. Which value should you use i.e. which value are the current one?

Post Reply