18:02, EEST
February 21, 2014
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
11:40, EEST
Moderators
February 11, 2020
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
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, biancacraft16Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1