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
Get a node from the client on the server in a specific type.
June 28, 2021
7:45, EEST
Avatar
Sabari
Member
Members
Forum Posts: 62
Member Since:
June 21, 2021
sp_UserOfflineSmall Offline

Hello,

i am trying to get a node on server by this way : uaClient.getAddressSpace().getNode(nodeId,CustomType.class)
but i get a BaseObjectTypeImpl not CustomType.

Does the SDK have another method to retrieve a node in the desired type ?

Thanks

June 28, 2021
8:48, EEST
Avatar
Matti Siponen
Moderator
Members

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

Hello,

What do you mean you get BaseObjectTypeImpl? If the Node cannot be cast to the specified class, then a ClassCastException is thrown by the getNode method.

June 28, 2021
9:20, EEST
Avatar
Sabari
Member
Members
Forum Posts: 62
Member Since:
June 21, 2021
sp_UserOfflineSmall Offline

Hello,
the uaClient.getAddressSpace().getNode(nodeId) returns a node with type BaseObjectTypeImpl while in the server the node is defined with type CustomType.
getNode(nodeId,CustomType.class ) throw ClassCastException.

Is there any other way to retrieve a node from the server with its right TypeDefinition ?

June 28, 2021
10:07, EEST
Avatar
Matti Siponen
Moderator
Members

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

Hello,

Has the Server application also been made with Prosys OPC UA SDK for Java? Has CustomType class been generated from a NodeSet file with the Code Generator? If it has been generated with the Code Generator, have you registered the the Information Model with UaClient.registerModel method?

If the getNode method is returning BaseObjectTypeImpl when no class is specified, then the type of the Node on Server would seem to be BaseObjectType. Have you verified that its HasTypeDefinition Reference targets CustomType TypeDefinition Node?

June 29, 2021
9:00, EEST
Avatar
Sabari
Member
Members
Forum Posts: 62
Member Since:
June 21, 2021
sp_UserOfflineSmall Offline

Hello,
I found that i was not register the information model with UaClient.registerModel method.
Now i get the node with the right TypeDefinition.

Thanks

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

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