Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
RepublishRequest
September 25, 2012
7:38, EEST
Avatar
Miggon
New Member
Members
Forum Posts: 2
Member Since:
June 26, 2012
sp_UserOfflineSmall Offline

Could you provide me an example to resolve an onMissingData notification?

September 25, 2012
9:21, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

It means that you are losing some data changes, most probably due to a communication break.

If you wish to ensure that all your items are up to date, you will need to perform a read call to verify the value of each item. The next version (to be released in the following weeks) will add a method Subscription.readAll() which will help you with this. It will look like the following:

public DataValue[] readAll(Double maxAge, TimestampsToReturn timestamps)
throws ServiceException {
MonitoredItemBase[] itemList = getItems();
ReadValueId[] nodesToRead = new ReadValueId[itemList.length];
for (int i = 0; i < itemList.length; i++)
if (itemList[i] instanceof MonitoredDataItem) {
MonitoredDataItem m = (MonitoredDataItem) itemList[i];
nodesToRead[i] = new ReadValueId(m.getNodeId(),
m.getAttributeId(), m.getIndexRange(),
m.getDataEncoding());
}
return client.read(maxAge, timestamps, nodesToRead).getResults();
}

You will need to synchronize this to your monitored change handling and verify the timestamps whether you are receiving the latest value for the read or for the monitored item.

Another option would be to recreate the subscription in the server by calling UaClient.removeSubscription() & addSubscription().

Unfortunately, the OPC UA specification does not define a better way to refresh the subscription in this kind of situation. They suggest that you try to prevent these situations instead, by reserving long enough resend buffers in the server. See the blog post http://www.prosysopc.com/blog/2012/01/26/jouni/opc-ua-sessions-subscriptions-and-timeouts/ more about the parameters. You may also need to modify the MaxRetransmissionQueueSize (or such) in the server parameters so that the server will keep enough packets to resend in this kind of situation.

September 26, 2012
7:49, EEST
Avatar
Miggon
New Member
Members
Forum Posts: 2
Member Since:
June 26, 2012
sp_UserOfflineSmall Offline

Thank you for your help

Jouni Aro said

It means that you are losing some data changes, most probably due to a communication break.

If you wish to ensure that all your items are up to date, you will need to perform a read call to verify the value of each item. The next version (to be released in the following weeks) will add a method Subscription.readAll() which will help you with this. It will look like the following:

public DataValue[] readAll(Double maxAge, TimestampsToReturn timestamps)
throws ServiceException {
MonitoredItemBase[] itemList = getItems();
ReadValueId[] nodesToRead = new ReadValueId[itemList.length];
for (int i = 0; i < itemList.length; i++)
if (itemList[i] instanceof MonitoredDataItem) {
MonitoredDataItem m = (MonitoredDataItem) itemList[i];
nodesToRead[i] = new ReadValueId(m.getNodeId(),
m.getAttributeId(), m.getIndexRange(),
m.getDataEncoding());
}
return client.read(maxAge, timestamps, nodesToRead).getResults();
}

You will need to synchronize this to your monitored change handling and verify the timestamps whether you are receiving the latest value for the read or for the monitored item.

Another option would be to recreate the subscription in the server by calling UaClient.removeSubscription() & addSubscription().

Unfortunately, the OPC UA specification does not define a better way to refresh the subscription in this kind of situation. They suggest that you try to prevent these situations instead, by reserving long enough resend buffers in the server. See the blog post http://www.prosysopc.com/blog/2012/01/26/jouni/opc-ua-sessions-subscriptions-and-timeouts/ more about the parameters. You may also need to modify the MaxRetransmissionQueueSize (or such) in the server parameters so that the server will keep enough packets to resend in this kind of situation.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 735

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1523

Posts: 6449

Newest Members:

rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1