How to change namespace url of variable? #1355
-
When I create variable, it's reserve id (i) for it, and then url for taking value looks like /example.freeopcua.io/*i. |
Beta Was this translation helpful? Give feedback.
Answered by
schroeder-
Jun 29, 2023
Replies: 1 comment 3 replies
-
You can read the namespace array via idx = await server.get_namespace_index("/example.freeopcua.io")
ua.NodeId("Light1", idx) or this ua.NodeId("/example.freeopcua.io/Light1", idx) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can pass a nodeid instead of the namespace index:
myobj.add_variable(ua.NodeId("Light1", idx), "Light1", 0.0, ua.VariantType.Float)
Or like this:
myobj.add_variable(f"ns={idx};s=Light1", "Light1", 0.0, ua.VariantType.Float)
or like this:
myobj.add_variable("ns=1;s=Light1", "Light1", 0.0, ua.VariantType.Float)