Modbus has some nodes called Flex, which means they handles values dynamically for read or write. Not sure why they call flex read for 'getter', but write is still write (not getter).
However, the client connection is still hardcoded in the node? Any way to set this dynamically also? Having used other connections like http, mqtt etc, they all support dynamic connection. Why not modbus?
Because when connection is hardcoded, we end up duplicating a lot of code per client, instead of setting it dynamically in msg variables.
NOTE: Each instance of the subflow will be a NEW connection (since the config belongs to the subflow template)
You should avoid adding multiple instances that connect to the same modbus device as it will create multiple connections. Instead, put logic in your subflow that reads/writes/whatever to the same config inside the subflow. you can do this using a pattern of your design (e.g. pass messages containing details like { payload: {values: [1,2,3], command: "write" }} or some other format)
And you can. I am just warning you if you add 2nd and 3rd instance of the subflow AND point them all to the same IP address, then multiple connections will be made. Just be aware.
The solution is to encapsulate everything to do with modbus in the single instance of the subflow.