Modbus TCP IP address and port into Parameters

Hi, i'm new into Node-red, i tried to use Modbus Flex Getter to read 32 Bit integers from a Modbus client (Schneider M221 PLC). Everything is OK but now, i want to change the IP Address of the Server used by the Modbus Flex Getter node without editing manually. I want that the Host IP address come from my database of mysql (coming from a local website). An IP wich can be change, not fixed.

Documentation talk about Function code, Address of station, start address and Quantity but don't talk about IP and Port.

msg.payload = { value: msg.payload, 'fc': 3, 'unitid': 1, 'address': 0 , 'quantity': 10 } return msg

I have seen an example on a website but it doesn't work for me, maybe i missed anything

var function_code=3;
var start_address=0;
var register_qty=8;
var slave_ip=msg.payload.slave_ip;
msg.payload={value: msg.payload, 'fc': function_code, 'unitid': 1, 'address': start_address , 'quantity': register_qty};
return msg;

Is it possible to add IP and Port parameters to this node ?
Also i see there is a Modbus Flex Connector : but i don't know how to use it and if it could be the solution.

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