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
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: 362
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: 362
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: 1919
Currently Online:
Guest(s) 66
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 100
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 773
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1558
Posts: 6567
Newest Members:
aracelyhaley4, raphaelschonell, Ashmag, kathyreimann56, brittanylemos, dorthycundiff76, PromotionToold, CHHinrichs, rodricklienhop, jose_Wanderlei
Moderators: Jouni Aro: 1039, Pyry: 1, Petri: 1, Bjarne Boström: 1054, Jimmy Ni: 26, Matti Siponen: 359, Lusetti: 0
Administrators: admin: 1