12:01, EEST
June 4, 2015
Hi everyone,
is there a way for a server to tell a client (in my case: the UaExpert client for testing purposes) to rebrowse automatically after a certain operation, like a method call? The client has no subscription for any events. Specifically, I need it to rebrowse a folder two layers above the node that has been called, in order to make visible what changed after calling the method.
There is a RefreshRequiredEventType in the Types folder which sounds like it could be the right direction. However, the following code put after the method call’s handling does not seem to do anything.
rebrowseCall.triggerEvent(null);
Do I need to add an EventManager or Listener somewhere (where?) or does the client have to subscribe in order to be influenced by events?
Thanks and regards,
danko
11:45, EEST
December 21, 2011
RefreshRequiredEventType is related to ConditionRefresh calls: the client is instructed to call that.
For model changes (address space changes) UA defines the GenericModelChangeEventType. UaExpert is also listening to these events (with a MonitoredItem) and will refresh the address space view automatically, when it receives such an event.
The SDK enables automatic model change events with NodeManagerRoot.beginModelChange()/endModelChange(). You will also need to define the NodeVersion property to the object nodes that are changing, to enable the event for these nodes. See the Javadoc of the mentioned NodeManagerRoot methods for more details.
14:35, EEST
June 4, 2015
Thanks a lot for the reply!
Jouni Aro said
RefreshRequiredEventType is related to ConditionRefresh calls: the client is instructed to call that.
Ah well, I was way off then.
Jouni Aro said
For model changes (address space changes) UA defines the GenericModelChangeEventType. UaExpert is also listening to these events (with a MonitoredItem) and will refresh the address space view automatically, when it receives such an event.
How would I send one of these? Following the example in MyNodeManager I think there needs to be an alarm node which triggers the event in a given situation. But a client would have to monitor this alarm node in order to get its events, wouldn’t it?
Jouni Aro said
The SDK enables automatic model change events with NodeManagerRoot.beginModelChange()/endModelChange(). You will also need to define the NodeVersion property to the object nodes that are changing, to enable the event for these nodes. See the Javadoc of the mentioned NodeManagerRoot methods for more details.
I’m probably doing it wrong. Here is what I have:
rootManager.beginModelChange();
rootManager.addModelChange(getNamespaceTable().toNodeId(myFolderId), Identifiers.FolderType, ModelChangeType.ReferenceAdded);
rootManager.endModelChange();
These lines are called when a new subfolder has been addes to myFolder. Rebrowsing myFolder manually makes the new subfolder appear in the list but without the rebrowse nothing changes.
Reading the documentation of NodeManagerRoot and I guess the problem lies in the versioning – as I’m using a custom NodeManager there is no node for myFolder I could call incNodeVersion() on to initialise the counter, only the ExpandedNodeId. Using a node here would beat the purpose of losing it in the first place, creating the address space dynamically from data. However, I’d still like changes concerning this data to show.
8:41, EEST
December 21, 2011
7:38, EEST
December 21, 2011
Turned out there was a minor bug in the SDK: UaExpert is using QueueSize=0 for the model change monitoring and this was not properly handled in the server side SDK to use the maximum queue size, instead. Fixed now and available as beta on request and also included in the (soon) upcoming 2.2.0 release.
Most Users Ever Online: 1919
Currently Online:
9 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: 731
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
inilarythikibia, rickykennion, PromotionToold, HypromeImpupe, toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1