Closed pascalporedda closed 2 years ago
It is already existing, look OPCUA-TEST-NODES.json
Tab: reconnect
I will extend actions to support disconnect & connect. Current implementation uses action "reconnect".
I extended actions:
Yeah I can verify that this is working as expected. Though I would still prefer being able to select end endpoint url from an ENV variable for example, because now I have to set the UaEndpoint everytime I call a method as well for example. Having the option to refer to an env variable inside the UA config node would make things easier.
Did you look older example? It will use msg that contains endpoint information...
Yes I've seen that, using a msg works fine but I would like to have this:
Instead of in a change node that sends a message to the OPC client rather here:
So that I could simply refer to an Env variable inside the config node or use a JSONata expression there.
Argh, can you change environment variable value during runtime?
Or use function node to build value and then inject msg.
Do you have example where this feature has been used? I found example from core nodes (inject). I will take a look next week.
Perfect, thank you. Yeah the Inject Node covers this feature.
Hi all, I believe it's already possible to use an environment variable for configuring the OpcUa-Endpoint node, we do something similar for our use case:
One thing to note is that the environment variable must be the full endpoint. Unfortunately cannot substitute just a part of the property. e.g. opc.tcp://{ENDPOINT}:48030
Hope this helps.
Hi @tedkim13 this looks promising, I'll try this 👍🏻 and leave you guys feedback once I know if this works or not.
Works perfectly fine. Thank you!
@pascalporedda could you please explain how you set the environment variable at runtime in this context? I thought you could only set them at startup
Hi, using the example OPCUA-TEST-NODES.json (tab reconnect) I am able to use the action "reconnect" in a function node but then when I try to use the action "browse" it will not browse on the new endpoint address space (after reconnecting). Instead, it will try to browse on the endpoint initially configured for the OPC UA Client node. There is a way of giving the msg.OpcUaEndpoint on the action "browse" like we do in "reconnect"?
Today I ran into the problem that I need the OPC client's node endpoint to be configurable, either via selecting an env variable, or setting the endpoint to an incoming messages property. Like, it is possible with many other nodes in NodeRED.
Would it be possible for you to add this feature?