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
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:
12 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 730

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1