I have implemented a Modbus TCP Master application using Node-Red. I am able to establish the read properly if I go to the flow settings and enter the Host IP address to the Server settings page. However now I want to have the user enter the Host IP address using a text box. I am referring to these links:
and I am able to get the IP address from the text box and send it to the modbustcp node. However every time the node tries to reconnect it keeps using the IP address that has been set in the flow settings of the node. Now there are two possibilities that could be messing up what I am doing -
- The variable that I am passing to the modbustcp node is incorrect
- Whenever the node - modbustcp tries to reconnect it keeps using the default values, so maybe I have to restart it by letting it know that it has to use the values received.
As far as Point 1 goes I have tried : node.host = in msb.payload OR msg - Both do not seem to work or rather it could be point 2 now.
2. Maybe I will have to restart the node programmatically for it to establish a socket on the new IP address.
I am trying it for one day and could not get to it. Tried looking for help online but I did not find anyone who ran into a similar issue.
Has anyone changed the IP address of the host programmatically while using the modbustcp node.
In fact I tried changing the poll rate dynamically but that also did not work. Not sure what is going on.
Any help will be appreciated.