Avatar
Please consider registering
guest
sp_LogInOut Log Insp_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 RSSsp_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/fo…..ated-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: 353
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:
Guest(s) 15
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 90
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 733
Moderators: 8
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1545
Posts: 6516
Newest Members:
basilpullman, Richardmip, mood edibles, LouieWreve, daniellabdx, janessan21, sammiebeak359, gena7127517, thorstenbouldin, Brett.Rollason
Moderators: Jouni Aro: 1029, Pyry: 1, Petri: 1, Bjarne Boström: 1045, Jimmy Ni: 26, Matti Siponen: 353, Lusetti: 0, Elias: 0
Administrators: admin: 1