# Modbus global configuration node server

**URL:** <https://discourse.nodered.org/t/modbus-global-configuration-node-server/63563>\
**Category:** General\
**Created:** [7 June 2022 11:20 UTC](https://discourse.nodered.org/t/modbus-global-configuration-node-server/63563 "2022-06-07T11:20:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aivaras1](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Aivaras1](https://discourse.nodered.org/u/Aivaras1)\
**Post date:** [7 June 2022 11:20 UTC](https://discourse.nodered.org/t/modbus-global-configuration-node-server/63563/1 "2022-06-07T11:20:59Z")

</div>

Hi,  
Can I change modbus server with a command ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/f/5f7af090b17cf9ab1413513965e187a795dcb3b6.png)

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [7 June 2022 13:22 UTC](https://discourse.nodered.org/t/modbus-global-configuration-node-server/63563/2 "2022-06-07T13:22:57Z")

</div>

Look into the **Modbus Flex Connector** Node .. (its in the modbus node collection)  
It allows you to modify and reconnect with new connection parameters.  
Read the node's side help for more information.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/1/01da0f65e2766b6c488c80fe62df6a519382649e.png)

---

<div class="post-metadata">

**Author:** ![Aivaras1](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Aivaras1](https://discourse.nodered.org/u/Aivaras1)\
**Post date:** [8 June 2022 06:40 UTC](https://discourse.nodered.org/t/modbus-global-configuration-node-server/63563/3 "2022-06-08T06:40:57Z")

</div>

Thank you 🙂 But does it work when trying to change a communication from serial to TCP ?  
Do I need to have seperate modbus TCP configuration in global configuration nodes ?

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [8 June 2022 09:55 UTC](https://discourse.nodered.org/t/modbus-global-configuration-node-server/63563/4 "2022-06-08T09:55:49Z")

</div>

I havent tried it extensively. The only test i did was with some simulator modbus tcp devices changing the connection ip and port.

In the documentation it mentions that you can send the following msgs to it to change the connection parameters :

```auto
//Function node code examples for TCP:
msg.payload = { 'connectorType': 'TCP', 'tcpHost': '127.0.0.1', 'unitId': 2 } 
return msg 

msg.payload = { 'connectorType': 'TCP', 'tcpHost': '127.0.0.1', 'tcpPort': '10502', 'unitId': 2 } 
return msg

//Function node code example for SERIAL:
msg.payload = { 'connectorType': 'SERIAL', 'serialPort': '/dev/USB02', 'serialBaudrate': '9600' 'unitId': 2 } 
return msg

```

Theorecally by setting `connectorType` you can even switch between TCP and SERIAL  
Only one way to find out .. have a go and let us know 😉

ps. the only extra information i can give you is that i notice a small delay when switching connection settings which you must take into account before any read / write.

---

<div class="post-metadata">

**Author:** ![Aivaras1](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Aivaras1](https://discourse.nodered.org/u/Aivaras1)\
**Post date:** [8 June 2022 10:55 UTC](https://discourse.nodered.org/t/modbus-global-configuration-node-server/63563/5 "2022-06-08T10:55:48Z")

</div>

After injecting this payload.

```auto
msg.payload = { 'connectorType': 'TCP', 'tcpHost': '127.0.0.1', 'tcpPort': '1502', 'unitId': 2 } 
return msg

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/2/d27ca11ff8131991f7315af2cabc35ead8b6b758.png)

Communication stops and begins with serial communication again

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [8 June 2022 11:28 UTC](https://discourse.nodered.org/t/modbus-global-configuration-node-server/63563/6 "2022-06-08T11:28:14Z")

</div>

Not enough information.  
Can you share your flow ? .. not that we will be able to check much (since we dont have your devices) but at least we can see how you connected and configured everything

---

<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:** [7 August 2022 11:29 UTC](https://discourse.nodered.org/t/modbus-global-configuration-node-server/63563/7 "2022-08-07T11:29:10Z")

</div>

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