-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use browsepath to get the value of node id. #1673
Comments
opcua-asyncio/asyncua/client/client.py Line 957 in cf27f8c
https://reference.opcfoundation.org/Core/Part4/v105/docs/A.2 rel path: "/0:Root/0:Objects/0:Server" (you need to use Browsenames!!! |
Thanks for your response. I have tried with below code and couldn't succeded.
We wanted something like this (below is the example of the reading value from node id, we wanted similar with reading value from browsepath ):
|
sorry in opc ua its two seperate services means always two seperate requests... not sure if root and object belongs to a "relative" path!? i used it just to show the syntax... |
its usually from the startnode the path to the node you want to get guess this is your rel path: |
Yes my start node is "ns=1;i=100" And I have tried with the relative_path as "/1:StatusWord" as below:
Below is the response I got in the paths: |
are you familiar with asyncio? asyncua_obj = asyncuaClient(address)
await asyncua_obj.connect()
paths = await asyncua_obj.translate_browsepaths(starting_node=node_address, relative_paths="/1:StatusWord")
print("paths", paths) you need to await the connect and the translate method call... |
opcua-asyncio/asyncua/client/client.py Line 957 in cf27f8c
as in the type hint its a ua.NodeId and not a string! node_address = ua.NodeId.from_string("ns=1;i=100")
async def connect():
asyncua_obj = asyncuaClient(address)
await asyncua_obj.connect()
paths = await asyncua_obj.translate_browsepaths(starting_node=node_address, relative_paths="/1:StatusWord")
print("paths", paths)
await asyncua_obj.disconnect()
asyncio.run(connect()) |
I am have a question on top of this answer:
you can only use nodeids for direct read!
the only thing you can do use the translate browsepath to nodeid service to get the nodeid and then read.
Originally posted by @AndreasHeine in #1228 (comment)
Basically our need is how we can read and write the values via browse name.
How to use the browse path in that case.
The text was updated successfully, but these errors were encountered: