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
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
Moderator
Members

Moderators
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
Moderator
Members

Moderators
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: 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

TimK: 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