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
An easy way for getting the method "DisplayName" attribute
November 21, 2018
10:07, EET
Avatar
agrillo
Member
Members
Forum Posts: 22
Member Since:
June 28, 2016
sp_UserOfflineSmall Offline

Hi,
I’m connecting on a OPC-UA Server from a Client GUI and I wish to get the “DisplayName” attribute of a method towards this client.
Is there an easy way to do that?
Thanks in advance and have a nice day.

November 22, 2018
10:19, EET
Avatar
Heikki Tahvanainen
Member
Members
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hi,

If you have obtained the UaMethod object on the client side, you can get the DisplayName by calling

UaMethod.getDisplayName();

Alternatively, you can just simply read the DisplayName attribute provided that you know the NodeId of the method node

UaClient.readAttribute(methodId, Attributes.DisplayName)

Let us know any further questions that you may have.

November 22, 2018
14:22, EET
Avatar
agrillo
Member
Members
Forum Posts: 22
Member Since:
June 28, 2016
sp_UserOfflineSmall Offline

Hi Heikki,
first of all, many thanks for your reply.
I’m obtaining the UaMethod in that way: UaClient.getMethod(new QualifiedName(“My_Method_Name”)). Is there a better way to do that?
If I wanted instead to get the NodeId of the method, how should I do? I would have expected to find something like “UaClient.MyObject.MyMethod.getNodeId()”, but I can’t find it. Is there something like this?
Thanks again and many greetings.
Alessandro

November 22, 2018
15:04, EET
Avatar
Heikki Tahvanainen
Member
Members
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hi Alessandro,

As you have obtained the UaMethod, you can just call .getDisplayName() and receive the value of the DisplayName attribute. Similarly, you can call .getNodeId() if you want to obtain the NodeId of method node.

P.s. There’s no such method as UaClient.getMethod but I’m assuming you meant UaObject.getMethod.

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online: Oleksandr, Josephdow
Guest(s) 83
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