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
Finding all nodes of a particular typedefinition
June 25, 2021
9:30, EEST
Avatar
Rakshan
Member
Members
Forum Posts: 30
Member Since:
June 2, 2019
sp_UserOfflineSmall Offline

Hello,
I have a server with objects/ nodes of different type definitions, spread across different folders. I need to list out all the nodes spread out inthe address space having a particular typedefinition. Which functionality of the SDK would help me herre?

Eg: Root
(1)Objects
Device
Boiler
Temperature –(A Type)
Pressure—(B TType)
Data (A Type)
Vendor
Manufacturer
Name –(A Type)

A structure like above. I have managed to get the NodeIDs of the Types. Need uidance on how to filter the browsing of address space. Please let me know

Regards,
Rakshan.

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

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

Hello,

You can use UaClient.getAddressSpace.browse(NodeId nodeId, BrowseDirection direction, NodeId referenceType) to get instances of a Type by using the NodeId of the Type as nodeId, BrowseDirection.Inverse as direction and Identifiers.HasTypeDefinition as referenceType.

July 1, 2021
16:08, EEST
Avatar
Rakshan
Member
Members
Forum Posts: 30
Member Since:
June 2, 2019
sp_UserOfflineSmall Offline

Hi,
Going by your explnation, suppose if A type has the NodeId( ns=2. i=1010), and i have collected all nodes inside the object folder in a a collection,
Now I run a loop for all the items in the collection, and I want to compare their typeDefinitions to that of the A type.
Is my understanding of your suggestion correct?

List rf = client.getaddressspace().browse(new nodeId(2,1010)), browseDirection.inverse, Identifier.hasTypedefinition)
This should refer to the type definition having of the type(ns=2,i=1010)

Please let me know if my understanding is correct.

Regards,
Rakshan

July 2, 2021
8:53, EEST
Avatar
Matti Siponen
Moderator
Members

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

Hello,

You originally asked how to get a list of ALL Nodes with particular TypeDefinition. You can do that with the UaClient.getAddressSpace.browse(NodeId nodeId, BrowseDirection direction, NodeId referenceType) method as I told you.

If you need to further filter the search by only selecting the Nodes that are contained in a specific Folder, you would need to call the browse method again for that Folder and then make an intersection of the lists returned by the methods.

You shouldn’t need to loop the Nodes one by one.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
12 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 685

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores Frederick, ellenmoss, harriettscherer

Moderators: Jouni Aro: 1009, 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