# Modbus TCP registers from one server

**URL:** https://discourse.nodered.org/t/modbus-tcp-registers-from-one-server/58313
**Category:** General
**Created:** [14 February 2022 12:53 UTC](https://discourse.nodered.org/t/modbus-tcp-registers-from-one-server/58313 "2022-02-14T12:53:26Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Milanovic](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Milanovic](https://discourse.nodered.org/u/Milanovic)
#### Post date: [14 February 2022 12:53 UTC](https://discourse.nodered.org/t/modbus-tcp-registers-from-one-server/58313/1 "2022-02-14T12:53:26Z")

</div>

Hi,

I am trying to read some Modbus registers with Node-RED, but I have a problem with the registers.  
The voltage registers are from adress 0 to 46 and the current registers from 128 to 236.

When I set the 'Quantity' on 236, I receive an error because there are a lot of registers not used (from 47 to 127). Two 'modbustcp' nodes in parallel didn't work because I they want to connect to the same server.

Is there anyone who knows how to solve this problem?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/f/8f6263c8f98d7467a071e6bec7c85ce3b41de9a9.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/d/7d8bc42d9bba2ee607e797492691a6f7ec87f130.png)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [14 February 2022 13:02 UTC](https://discourse.nodered.org/t/modbus-tcp-registers-from-one-server/58313/2 "2022-02-14T13:02:02Z")

</div>

Due to protocol design, there is a limit on the number of registers (I cant find the info right now but its about 100)

So, make 3 requests in series

1. Registers 0 (47 long)
2. Registers 128 (100 long)
3. Registers 228 (8 long)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/c/ec4a7ee7b05b7feb090901e0a8bfc3e80da93b46.png)

PS, buffer-parser can make simple work of converting the int16 values into sensible results (bools/floats/32 bit numbers, all in a nicely named object)

---

<div class="post-metadata">

### Author: ![Milanovic](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Milanovic](https://discourse.nodered.org/u/Milanovic)
#### Post date: [14 February 2022 13:05 UTC](https://discourse.nodered.org/t/modbus-tcp-registers-from-one-server/58313/3 "2022-02-14T13:05:53Z")

</div>

Hi,

I can't install that nodes of Modbus, every time I try to install that nodes I get an error

---

<div class="post-metadata">

### Author: ![Milanovic](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Milanovic](https://discourse.nodered.org/u/Milanovic)
#### Post date: [14 February 2022 13:13 UTC](https://discourse.nodered.org/t/modbus-tcp-registers-from-one-server/58313/4 "2022-02-14T13:13:12Z")

</div>

@Steve-Mcl can you show your program inside the 'set msg.result.data1'?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [14 February 2022 13:16 UTC](https://discourse.nodered.org/t/modbus-tcp-registers-from-one-server/58313/5 "2022-02-14T13:16:36Z")

</div>

> [@Milanovic](#):
>
> every time I try to install that nodes I get an error

What is the error. Have you reported this anywhere?

> [@Milanovic](#):
>
> can you show your program inside the 'set msg.result.data1'?

It was a non working demo (for visual purposes) whereby i try to show that you should copy the output of each modbus read into a single objects properties so that later in the flow, all parts of the modbus data would be available in one place for the buffer parser node can convert all the int16 data into nicely formatted int32/float/bool or whatever.

---

<div class="post-metadata">

### Author: ![Milanovic](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Milanovic](https://discourse.nodered.org/u/Milanovic)
#### Post date: [14 February 2022 13:20 UTC](https://discourse.nodered.org/t/modbus-tcp-registers-from-one-server/58313/6 "2022-02-14T13:20:39Z")

</div>

@Steve-Mcl  
this is the error :  
2022-02-14T13:19:48.913Z Install : node-red-contrib-modbus 5.21.0

2022-02-14T13:19:48.922Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-modbus@5.21.0  
2022-02-14T13:19:54.980Z [err] npm  
2022-02-14T13:19:54.980Z [err] WARN deprecated ini@1.3.5: Please update to ini \>=1.3.6 to avoid a prototype pollution issue  
2022-02-14T13:19:57.071Z [err] npm  
2022-02-14T13:19:57.071Z [err] ERR! code 1  
2022-02-14T13:19:57.071Z [err] npm ERR! path  
2022-02-14T13:19:57.071Z [err] C:\Users\User.node-red\node\_modules@serialport\bindings  
2022-02-14T13:19:57.073Z [err] npm  
2022-02-14T13:19:57.073Z [err] ERR! command failed  
2022-02-14T13:19:57.073Z [err] npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild  
2022-02-14T13:19:57.073Z [err] npm ERR!  
2022-02-14T13:19:57.073Z [err] prebuild-install WARN install No prebuilt binaries found (target=17.5.0 runtime=node arch=x64 libc= platform=win32)  
2022-02-14T13:19:57.073Z [err] npm ERR! gyp info it worked if it ends with ok  
2022-02-14T13:19:57.073Z [err] npm ERR!  
2022-02-14T13:19:57.073Z [err] gyp info using node-gyp@3.4.0  
2022-02-14T13:19:57.073Z [err] npm ERR! gyp info using node@17.5.0 | win32 | x64  
2022-02-14T13:19:57.073Z [err] npm  
2022-02-14T13:19:57.073Z [err] ERR! gyp ERR! configure error  
2022-02-14T13:19:57.073Z [err] npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.  
2022-02-14T13:19:57.073Z [err] npm  
2022-02-14T13:19:57.073Z [err] ERR! gyp ERR! stack at failNoPython (C:\Users\User.node-red\node\_modules\node-gyp\lib\configure.js:449:14)  
2022-02-14T13:19:57.073Z [err] npm ERR! gyp ERR! stack at C:\Users\User.node-red\node\_modules\node-gyp\lib\configure.js:404:11  
2022-02-14T13:19:57.073Z [err] npm ERR! gyp ERR! stack at callback (C:\Users\User.node-red\node\_modules\graceful-fs\polyfills.js:295:20)  
2022-02-14T13:19:57.073Z [err] npm ERR!  
2022-02-14T13:19:57.073Z [err] gyp ERR! stack at FSReqCallback.oncomplete (node:fs:198:21)  
2022-02-14T13:19:57.073Z [err] npm  
2022-02-14T13:19:57.073Z [err] ERR! gyp ERR! System Windows\_NT 10.0.19043  
2022-02-14T13:19:57.073Z [err] npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\User\.node-red\node\_modules\node-gyp\bin\node-gyp.js" "rebuild"  
2022-02-14T13:19:57.073Z [err] npm ERR!  
2022-02-14T13:19:57.073Z [err] gyp ERR! cwd C:\Users\User.node-red\node\_modules@serialport\bindings  
2022-02-14T13:19:57.073Z [err] npm ERR! gyp ERR! node -v v17.5.0  
2022-02-14T13:19:57.073Z [err] npm ERR! gyp ERR! node-gyp -v v3.4.0  
2022-02-14T13:19:57.073Z [err] npm ERR!  
2022-02-14T13:19:57.073Z [err] gyp ERR! not ok  
2022-02-14T13:19:57.074Z [err]  
2022-02-14T13:19:57.074Z [err] npm  
2022-02-14T13:19:57.074Z [err] ERR! A complete log of this run can be found in:  
2022-02-14T13:19:57.074Z [err] npm ERR! C:\Users\User\AppData\Local\npm-cache\_logs\2022-02-14T13\_19\_49\_631Z-debug-0.log  
2022-02-14T13:19:57.093Z rc=1

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [14 February 2022 13:29 UTC](https://discourse.nodered.org/t/modbus-tcp-registers-from-one-server/58313/7 "2022-02-14T13:29:28Z")

</div>

> [@Milanovic](#):
>
> Can't find Python executable "python", you can set the PYTHON env variable

You probably didnt install the "build tools" when you installed node-js - these are required for some nodes (like the serial port nodes which are part of modbus nodes)

I would recommend you uninstall node-js V17, re-install V16 LTS and be certain to install the "build tools"

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

---

<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: [15 April 2022 13:30 UTC](https://discourse.nodered.org/t/modbus-tcp-registers-from-one-server/58313/8 "2022-04-15T13:30:18Z")

</div>

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