7:38, EEST
June 26, 2012
9:21, EEST
December 21, 2011
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:
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.
7:49, EEST
June 26, 2012
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.
Most Users Ever Online: 1919
Currently Online:
8 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: 728
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1