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
GetNode in UaClient performance
December 12, 2014
9:55, EET
Avatar
Xavier
Member
Members
Forum Posts: 43
Member Since:
March 26, 2014
sp_UserOfflineSmall Offline

Hi,

I would like to know if the SDK 2.0 function to read a Node to retreive a full object is making client/server calls each time you use a getter ?
For instance :
MyObject o = (MyObject) addressSpace.getNode(id);
o.getPropA(); // one call to the server ?
o.getPropB(); // another call to ther server ?

If that’s the case, is there a possibility to retreive “eagerly” all its properties at once to have better performance ?

Regards

December 12, 2014
11:51, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

There is a NodeCache in AddressSpace. You can use
client.getAddressSpace().getCache().setNodeMaxAgeInMillis(nodeMaxAgeInMillis);
to set a maximum age for a node. If node is older than the age, then it will be read again from the server. The default max age is one second.

AddressSpace.getNode will read all Properties of that node also at the same time. So if you read the property “fast enough” then it will not read it from the server.

Note that the value of the node does not change as long as it is in the cache, unless you read the value.

We will provide improvements to this configuration at some point in the future.

December 16, 2014
18:00, EET
Avatar
Xavier
Member
Members
Forum Posts: 43
Member Since:
March 26, 2014
sp_UserOfflineSmall Offline

Hi,

I think it’s ok. I rested and it is called as you described and I think it’s fine. When you call a getSubComponentNode() then I think it does the getComponents() but it also seems fine.

But I have another question: if I get a node and then later use setValue or another set method I don’t think it is sent to the server. Is there a way to to it ? Or I can only use the client’s writeValue method ?

Or otherwise, can I get a node from the server, modify it with set methods and at some point send all the changes to the server ?

And a last question regarding the AddressSpace functions: If I use deleteNode or addNode or query methods I get the “not supported” error. Is it not supported by the client, server or both? Do you have any plan to support these functions in the future ?

Thanks.

December 17, 2014
9:27, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

You are correct, the setValue does not send the value to the server. The setValue is used by the SDK internally when a node read from the server. So for now you must use UaClient’s read/write methods (or clear the node from cache to read again when getNode). With those, you can also read/write multiple values at a time.

“Or otherwise, can I get a node from the server, modify it with set methods and at some point send all the changes to the server ?”
Currently, no.
We hope to provide some other way than just using the UaClient for read/write in the future. We have some ideas, but it’s not trivial to implement (since the connection can be lost; server might reject new values; might accept only some=>the client side node would be inconsistent; not fun to code if every Attribute setter would throw 2 checked exceptions etc.)

The “not supported” should be a service-level error code from the server (which is normal, if the server doesn’t support that feature)
add/deleteNode:
The/That server might not support NodeManagement. In our SDK that is by default not supported. You can enable it with NodeManagerTable.setNodeManagementEnabled(true). Note that if you do, then you should have some user authentication/authorization mechanism in place, for example by adding NodeManagerListeners to NodeManagers.

Query:
Query is not supported by many servers in general. In our SDK, you can support it at application level by adding a NodeManagerTableListener to NodeManagerTable. Its not that well documented at the moment, but it has queryFirst and queryNext methods you can implement. Now on closer look we probably need to add methods to that interface later.. Note that the NodeManagerTableListener is just an “entry-point” for the service call, i.e. there is no logic at SDK level to support Query. Implementing the Query might be non-trivial, unless the whole address space is in a database or similar datastructure.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores Frederick

Moderators: Jouni Aro: 1009, 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