# Modbus TCP IP address and port into Parameters

**URL:** <https://discourse.nodered.org/t/modbus-tcp-ip-address-and-port-into-parameters/47354>\
**Category:** Industrial\
**Created:** [18 June 2021 23:44 UTC](https://discourse.nodered.org/t/modbus-tcp-ip-address-and-port-into-parameters/47354 "2021-06-18T23:44:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Makimax](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Makimax](https://discourse.nodered.org/u/Makimax)\
**Post date:** [18 June 2021 23:44 UTC](https://discourse.nodered.org/t/modbus-tcp-ip-address-and-port-into-parameters/47354/1 "2021-06-18T23:44:24Z")

</div>

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.

```auto
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

```auto
var function_code=3;
var start_address=0;
var register_qty=8;
var slave_ip=msg.payload.slave_ip;
msg.slave_ip="192.168.100.202";
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 : [https://discourse.nodered.org/t/modbus-flex-connector-example/24447](https://discourse.nodered.org/t/modbus-flex-connector-example/24447) but i don't know how to use it and if it could be the solution.  
Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [17 August 2021 23:45 UTC](https://discourse.nodered.org/t/modbus-tcp-ip-address-and-port-into-parameters/47354/2 "2021-08-17T23:45:03Z")

</div>

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