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
Navigating To Leaf Nodes
September 25, 2014
14:54, EEST
Avatar
OndrejBlazek
Member
Members
Forum Posts: 19
Member Since:
July 22, 2014
sp_UserOfflineSmall Offline

I am working on the following partial code which is trying to display some information about the desired node…

NodeId myNode = Identifiers.RootFolder;

myNode = sampleClient.getNodeFromBrowseString("Objects|@|Computer|ICONICS.SimulatorOPCDA.2_DA|DEP00_SCEx_SWD01x_B02");

System.out.println("Node: "+myNode.toString());

UaNode uNode = sampleClient.getAddressSpace().getNode(myNode);

System.out.println("Browse Name: "+uNode.getBrowseName());
System.out.println("Node Name: "+uNode.getNodeId());
System.out.println("Display Name: "+uNode.getDisplayName());

Where the getNodeFromBrowseString() is a function that returns a NodeId object. As is, the code resolves the NodeId (as far as I can tell because it prints out what appears to be a valid NodeId result) but then generates a:

Exception in thread “main” com.prosysopc.ua.ServiceException: Bad_Timeout (code=0x800A0000, description=”The operation timed out.”) ServiceResult=Bad_Timeout (0x800A0000) “The operation timed out.”

when trying to convert the NodeId into a UaNode. Since I want to display various information about the node (such as BrowsePath, Display Name, Description and attributes), I need to convert the NodeId to a UaNode (as far as I understand) because NodeId does not provide access to this information whereas UaNode does.

In the case of the above code, the provided BrowseString is a path to a Leaf Node (which would have attributes/properties but no further children). When I modify the code slightly to point to a non-Leaf node, such as:

myNode = sampleClient.getNodeFromBrowseString(“Objects|@|Computer|ICONICS.SimulatorOPCDA.2_DA”);

The code runs fine and the conversion from NodeId to UaNode succeeds.

What am I doing wrong? As I said, the NodeId seems to be valid in both cases so I don’t believe it is related to my getNodeFromBrowseString() function.

Note: The server is a DA server which Iconics exposes as a UA compliant OPC server. This is why the same of the server contains DA.

September 25, 2014
18:57, EEST
Avatar
OndrejBlazek
Member
Members
Forum Posts: 19
Member Since:
July 22, 2014
sp_UserOfflineSmall Offline

Hmm…I wonder if this is something related to the fact that particular OPC Server? I tried the same code with UA Sample Server and it seems to work.

Is it possible that the ICONICS Server isn’t implementing the leaf nodes as UaNodes and thus the conversion is failing?

September 25, 2014
19:30, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Well, it would help to know what your getNodeFromBrowseString does. But, note that there is a similar service available already in OPC UA and you can use it from UaClient.getAddressSpace().translateBrowsePathToNodeId(). Also note that the browse names are QualifiedName:s and you need to provide the correct NamespaceIndex for each: plain string may not be the correct one, unless the node is in the standard namespace (NamespaceIndex=0).

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

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

inilarythikibia, rickykennion, PromotionToold, HypromeImpupe, toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466

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

Administrators: admin: 1