Exactly this .. its used to change the Modbus config dynamically
In the Help tab of the node it shows some examples of how that msg should be
msg.payload = { 'connectorType': 'TCP', 'tcpHost': '192.168.0.100', 'tcpPort': '502', 'unitId': 1 }
return msg
The thing is the Modbus Flex Connector will not trigger a modbus Read / Write itself .. it will just change the config. You still need to use a Modbus-Flex-Getter node to do that.
Note that both the Connector and Getter are using the same config.
Sample Flow :
[{"id":"0617a95e616b94a7","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":170,"y":1720,"wires":[["898afaf3b661843f"]]},{"id":"898afaf3b661843f","type":"function","z":"54efb553244c241f","name":"192.168.0.100","func":"msg.payload = {\n 'connectorType': 'TCP',\n 'tcpHost': '192.168.0.100',\n 'unitId': 1\n}\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":1720,"wires":[["678bbb6347399e7b"]]},{"id":"678bbb6347399e7b","type":"modbus-flex-connector","z":"54efb553244c241f","name":"","maxReconnectsPerMinute":4,"emptyQueue":false,"showStatusActivities":true,"showErrors":true,"server":"464f5fed7e44856a","x":590,"y":1800,"wires":[["71a1c0cb1c397b23"]]},{"id":"71a1c0cb1c397b23","type":"debug","z":"54efb553244c241f","name":"debug 30","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":820,"y":1800,"wires":[]},{"id":"51cededc559f5cf6","type":"function","z":"54efb553244c241f","name":"192.168.0.101","func":"msg.payload = {\n 'connectorType': 'TCP',\n 'tcpHost': '192.168.0.101',\n 'unitId': 1\n}\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":1800,"wires":[["678bbb6347399e7b"]]},{"id":"61d2e5849bb550d8","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":170,"y":1800,"wires":[["51cededc559f5cf6"]]},{"id":"c271b2e90284c677","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":170,"y":2060,"wires":[["4819d151c4601f3b"]]},{"id":"4819d151c4601f3b","type":"function","z":"54efb553244c241f","name":"Modbus msg","func":"msg.payload = {\n 'value': msg.payload,\n 'fc': 3,\n 'unitid': 1,\n 'address': 3072,\n 'quantity': 14\n}\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":2060,"wires":[["8aa3796a635e873c","25a516684b9ffaf4"]]},{"id":"8aa3796a635e873c","type":"modbus-flex-getter","z":"54efb553244c241f","name":"","showStatusActivities":true,"showErrors":true,"showWarnings":true,"logIOActivities":false,"server":"464f5fed7e44856a","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":590,"y":2060,"wires":[["4ee1b336b2b08fc1"],[]]},{"id":"4ee1b336b2b08fc1","type":"debug","z":"54efb553244c241f","name":"debug 39","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":800,"y":2040,"wires":[]},{"id":"469c4452f8da61b6","type":"function","z":"54efb553244c241f","name":"192.168.0.102","func":"msg.payload = {\n 'connectorType': 'TCP',\n 'tcpHost': '192.168.0.102',\n 'unitId': 1\n}\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":1880,"wires":[["678bbb6347399e7b"]]},{"id":"45940cfa17d819f6","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":170,"y":1880,"wires":[["469c4452f8da61b6"]]},{"id":"25a516684b9ffaf4","type":"debug","z":"54efb553244c241f","name":"debug 52","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":500,"y":1980,"wires":[]},{"id":"464f5fed7e44856a","type":"modbus-client","name":"Modbus Config","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"failureLogEnabled":true,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true,"showWarnings":true,"showLogs":true}]