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: 1010
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: 518

Currently Online:
20 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

TimK: 41

Member Stats:

Guest Posters: 0

Members: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1