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
UaClient: Re-initialize TypeDictionary on demand
September 2, 2020
18:02, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 135
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

Greetings,

the following question is related to the topic https://forum.prosysopc.com/forum/opc-ua-java-sdk/uaclient-reading-custom-structured-datatype-without-generated-code/

When my custom client connects to a (aggregation) server, the server might not yet have made all type definitions available in its addressSpace. Once the type definitions became available, I need to re-initialize the client’s TypeDictionary. What would be the best way to do so?

In the TypeDictionary’s class I found an “init()” method which in turn calls various resolve…() methods. Is this intended for the initialization of the dictionary on demand?

Thanks,
Hans-Uwe

NB: using SDK 4.3.0

September 3, 2020
11:40, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 321
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello Hans-Uwe

TypeDictionary.init() method is called when an UaClient connects to the Server and initTypeDictionaryOnConnect has been set to true, which is also its default value. If you attempt to call TypeDictionary.init() method manually from your code after it has already been called, it won’t do anything as the TypeDictionary has already been initialized. Instead, you need to call TypeDictionary.refresh(), which clears old definitions and reads new ones from the Server.

If you think that the Server isn’t ready to provide a proper TypeDictionary when you’re connecting to it, you should set initTypeDictionaryOnConnect to false with UaClient.setInitTypeDictionaryOnConnect(boolean initTypeDictionaryOnConnect) and call TypeDictionary.init() when the Server is ready and later TypeDictionary.refresh() if the TypeDictionary needs to be updated. This will save you the time it would take to initialize the TypeDictionary.

BR,
Matti

September 3, 2020
15:17, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 135
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

Thanks a lot for your quick reply and explanations.

Regards,
Hans-Uwe

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
23 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

fred: 41

Member Stats:

Guest Posters: 0

Members: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com

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