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: 144
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: 346
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: 144
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: 1919

Currently Online:
12 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: 735

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1523

Posts: 6449

Newest Members:

rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1