Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Browsing OPC UA servers with multi select - Getting the NodeElement Brows names

More
23 Nov 2020 16:33 #9221 by support
Yes.
Add .Name to the end of your statement. So it would be something like
szDisplayName = values(i).BrowsePath.GetLastElement().TargetName.Name
The browse name in OPC UA is a qualified name, so it also contains the namespace (in this sense, it is similar to node Ids, except that the browse name does not have 4 identifier types, besides the namespace there is always just a name part which is always a string).

So what you've get from .TargetName is UAQualifiedName class. And when you get a string from it will convert to its full string representation.
If you want just parts of it, you can use .Name, .NamespaceUri, or .NamespaceIndex - this is very similar to UA node IDs too.

opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User's...e.UAQualifiedName_members.html

A bit of warning: It is possible that you are mixing up some terms here.
Your original question was about the browse name, and that is what I am answering.

But the name of your variable is "szDisplayName". You should be aware the in OPC UA, display name is not the same thing as browse name (although it is not uncommon that the display name is the same as the name part of the browse name).

The difference between the two can be put shortly like this: Browse names are for computers, display names are for humans.

Best regards
The following user(s) said Thank You: micham

Please Log in or Create an account to join the conversation.

More
23 Nov 2020 16:07 #9220 by micham
Hi,

Thank you for your answer. When I use:
szDisplayName = values(i).BrowsePath.GetLastElement().TargetName

I get that szDisplayName is equal to "nsu=http://opcfoundation.org/UA/Boiler/ ;ns=4;s=ControlOut"

What I need is just "ControlOut". Can I get just this?

Thank you.

Michael

Please Log in or Create an account to join the conversation.

More
23 Nov 2020 10:36 #9218 by support
There are two approaches to do this.

One of them is actually similar to what you have hinted to in your picture. Upon output from multi-select UADataDialog, both NodeDescriptors and NodeElements arrays are filled in. And, they use have the same indexes (so, in VB.NET, NodeDescriptors(0) corresponds to NodeElements(0) etc.). For an index i, you can get the browse name using NodeElements(i).BrowseName.

The second approach uses the fact that upon output from UADataDialog, each NodeDescriptor contains not just the Node ID but also the browse path, and the last element in the browse path contains the browse name of the node (if the browse path is not empty). So, for an index i, you can get the browse name using NodeDescriptors(i).BrowsePath.GetLastElement().TargetName.

Best regards

Please Log in or Create an account to join the conversation.

More
23 Nov 2020 06:36 #9217 by micham
Hi,
I need to get the NodeElement Browse Names when multiselct = True.

I need something similar to:
values = uaDataDialog1.NodeDescriptors
but for the Browse names.

Thank you.

Michael
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.070 seconds