OPC UA dynamical namespaces index

Hello Forum,

I search a way to define the nodeid dynamically in a read flow for a OPC client . instead of ( fixed ns index)
ns=10;s=Devices.CmdChangeRequest
something like:
global.get('namespace');s=s=Devices.CmdChangeRequest
but I get an error :
Error: String cannot be coerced to a nodeId : global.get('namespace');s=Devices.CmdChangeRequest
Is there a way to do it?
Thanks a lot.

ok. this can be done with a function after the node.. but Is it possible to evaluate something directly in the property? with $eval? An other way to solve it to fork the node and add the namespace as a property..
No suggestion?

Hi, you don't mention exactly which node you are using so tricky to guess as I don't use OPC-UA - How dynamic do you need it ? If per runtime then you may be able to set it in the node by using an environment variable like ${MY_OPC_READ_CONFIG} and set that externally to Node-RED to the complete ns=10;s=Devices.CmdChangeRequest string. Or using a function node or template node before sending to the node is probably the easiest way as you suggest.

You may want to discuss withe the node's author but I think breaking apart that string while attractive, may break the operation of the node - or at least break existing users - unless designed carefully.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.