Hello.
(1) OpcCmd is based on QuickOPC. In QuickOPC, nodes are identified by
node descriptors.A node descriptor can contain a Node ID, a browse path, or both. When it contains both, it is the responsibility of the whoever
produces the node descriptor that the node Id and the browse path represent the
same node (this, for example, is how node descriptor come out of node browsing). When the node descriptor is
consumed, the consumer part (usually inside QuickOPC), if both parts are present, can take either the node ID, or the browse path, whatever is easier or more efficient to work with in particular case. In most cases, it is the node ID (but not always). So, when you have specified a Node ID and a browse path that does not correspond to that node ID, you have already passed in incorrect information. They need to refer to the same node, OR you need to use just one of them. In your case, if what you have in hand is only the browse path, simply do not specify the node ID.
(2) Do not use single quotes around the OpcCmd arguments. If you need an argument that contains characters such as a space or colon, use double quotes around the arguments.
Here is a commands that works, for example:
OpcCmd uaClient read //opcua.demo-this.com:51210/UA/SampleServer -nbp [ObjectsFolder]/2:Data/2:Static/2:UserScalar/2:Int32Value
However, there is a problem with the
browse command you want to use. The above example (with
read) works, because the default for node ID in that command is none (a "null" node Id). The default node ID in the
browse command is the Root node instead. This means that when you specify a browse path with it, you are right in your observation, it will use the Root, as described in (1) above. In order to force the
browse command to use the browse path, we need to set the node Id from Root to null. Unfortunately, I have discovered a bug that makes it impossible to achieve in your version of OpcCmd.
I have fixed the bug now. You will need OpcCmd version 5.71.0.20 or later. It should automatically update for you if you have used ClickOnce to get it (from
kb.opclabs.com/Tool_Downloads#OpcCmd_Utility ), but it may take a day before it re-checks itself for updates; or you need to force the update somehow.
With the new update, commands like this work:
OpcCmd uaClient browse //opcua.demo-this.com:51210/UA/SampleServer -nsn "" -nbp [ObjectsFolder]/2:Data/2:Static/2:UserScalar
Note the use of
-nsn "" to set the node Id to Null.
I hope this helps