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
Issue while read tag name from Kepware UA server
September 27, 2017
20:15, EEST
Avatar
bijesh.r@tcs.com
Member
Members
Forum Posts: 11
Member Since:
June 21, 2017
sp_UserOfflineSmall Offline

Hi Team,
We aare facing one issue while reading node name from the kepware ua server. With Browse name there is (en) getting appended with name and with display name “2:” getting appended with the tag name.
Please see the code below and its corresponding value:
NodeId nodeId=new NodeId(2, “Channel1.Device1.TestDevice1”);
String displayName = client.readAttribute(nodeId, Attributes.BrowseName).getValue().toString();

Output :2:TestDevice1

With following code:String displayName = client.readAttribute(nodeId, Attributes.DisplayName).getValue().toString();

Output: (en) TestDevice1

Any idea how can I get the absolute tag Name i.e . TestDevice1 without anything else appended to it. Please advice.

September 28, 2017
12:52, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 982
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

What you are seeing is the “absolute tag name”, i.e. it is supposed to have the number part. Please read OPC UA Specification Part 3 for the different Attributes. Each of them maps to a class which you can cast the value to. Note that in OPC UA there is no concept of Tag the same way in old OPC had. In UA the NodeId Attribute is the unique identifier for a node.

BrowseName Attribute is a QualifiedName, which has a namespace index part and name part. It has .getName(), which can be used to get the name part. i.e.

((QualifiedName) client.readAttribute(nodeId, Attributes.BrowseName).getValue()).getName();

DisplayName Attribute is a LocalizedText, which contains a locale part and the text part. It has .getText(), which can be used to get the text part.

Note that you can also call client.getAddressSpace().getNode(nodeId) and get the attributes from the UaNode.

– Bjarne

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
19 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 75

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 707

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1466

Posts: 6253

Newest Members:

christi10l, ahamad1, Flores Frederick, ellenmoss, harriettscherer, shanonhumphreys, KupimotoblokfuB, tamhollander5, paulinafcf, bridgette18l

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 982, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 319, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1