1

I have a scenario where the OPCUA client have no idea about the construction of the OPCUA server address space, still the client knows the connection credentials. Can the OPCUA client still access the data from the server without the namespace and node id.

I have been getting the server data by specifying the namespace and node id during the client request.

Can anyone help me knowing the OPC UA data access in detail?

John Desilva
  • 43
  • 1
  • 6
  • if the suggestion below answers your question, please accept it. See also: https://stackoverflow.com/help/someone-answers – Stefan Profanter Aug 07 '17 at 14:49
  • Possible duplicate of [OPC UA : minimal code that browses the root node of a server](https://stackoverflow.com/questions/30573689/opc-ua-minimal-code-that-browses-the-root-node-of-a-server) – astrowalker Aug 08 '17 at 06:05

1 Answers1

2

TL;DR; Yes, you can use the Browse Service to get a list of all nodes within the server.


More Detailed answer:

Every Server should at least have the following nodes (folders). In Parenthesis is the node ID in namespace 0 (the OPC UA base namespace) which is given by the specification.

- Root (i=84)
    - Objects (i=85)
    - Types (i=86)
    - Views (i=87)

The OPC UA Specification Part 4 can be downloaded for free after registering from here OPC UA Specification. It defines the Services Browse and BrowseNext. Using these services, you can indicate a start node (i.e., one of the nodes above, e.g., Root = namespace 0, ID 84) and get all its children.

In node-opcua you can find some example code probably in here: https://github.com/node-opcua/node-opcua/blob/fd5e48bac996625aaa7c177d1f8ed0c40ee92fbc/test/end_to_end/u_test_e2e_BrowseRequest.js

In open62541 the example for browsing nodes is shown here: https://github.com/open62541/open62541/blob/master/examples/client.c#L55

Stefan Profanter
  • 6,458
  • 6
  • 41
  • 73
  • Thanks for your answer! I know about browse node, for instance i know only the name of the node (ex: 'MotorID'). Do you have to browse through all the objects to find the MotorID comparison to change the value or is there any other good way. ( For i can see that the easiest and efficient way is if i know the (ns: i:) – John Desilva Aug 08 '17 at 05:32
  • If you only know the name of the node and nothing else you need to browse trough all the nodes (you can also apply some filters to reduce the number of nodes to be searched). If you also know the parent node names, i.e., the path (/Objects/Stuff/MotorId) then you can use the service `TranslateBrowsePathToNodeId` which gives you the node ID for a specific path. – Stefan Profanter Aug 08 '17 at 11:01