# Modbus Data correctly read out

**URL:** <https://discourse.nodered.org/t/modbus-data-correctly-read-out/32776>\
**Category:** General\
**Created:** [12 September 2020 12:52 UTC](https://discourse.nodered.org/t/modbus-data-correctly-read-out/32776 "2020-09-12T12:52:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [12 September 2020 12:52 UTC](https://discourse.nodered.org/t/modbus-data-correctly-read-out/32776/1 "2020-09-12T12:52:49Z")

</div>

Hi,  
I want to read out some Data from my Inverters (SMA) over modbus tcp, it works but I get a "0" in front of the value:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/3/3378c8fb38512316890da4a9eee1ccf82ac9a68c.png)  
0, 2695  
I only need the second value: 2695 (W).

In a windows app is the same:  
 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/1/2117882126ba7424ac9a85569ad55041cdfbf36a.png)  
+0: 0  
+1: the value I need. (in this picture the frequency)

How can I get the second value only ?

greetings

---

<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:** [12 September 2020 13:15 UTC](https://discourse.nodered.org/t/modbus-data-correctly-read-out/32776/2 "2020-09-12T13:15:39Z")

</div>

Hi Becker,

what if you try reading from **Address 30776** and **Quantity 1**

but i guess your result will still be in an array that you can access with **msg.payload[0]**

---

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [12 September 2020 13:20 UTC](https://discourse.nodered.org/t/modbus-data-correctly-read-out/32776/3 "2020-09-12T13:20:43Z")

</div>

Quantity1 will be error, no data ☹  
I´ve no idea what Quantity means

---

<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:** [12 September 2020 13:25 UTC](https://discourse.nodered.org/t/modbus-data-correctly-read-out/32776/4 "2020-09-12T13:25:04Z")

</div>

Quantity means how many addresses to read starting from 30775 .. that why you get an array with two elements.

What is the error and what node produces that error ? .. put a **debug** node after your modbus tcp node with the above configuration.

---

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [12 September 2020 13:49 UTC](https://discourse.nodered.org/t/modbus-data-correctly-read-out/32776/5 "2020-09-12T13:49:23Z")

</div>

just disconnect:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/8/0868777c2d566dccc64f62b426940abcad59b444.png)

the other inverter crashed when I queried more than 4 data.  
How can I query the registers one after the other so that the Invert does not crash ?

---

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [12 September 2020 14:00 UTC](https://discourse.nodered.org/t/modbus-data-correctly-read-out/32776/6 "2020-09-12T14:00:49Z")

</div>

this is the solution,

function with:

var temp = (msg.payload[1])  
msg.payload = temp;  
return msg;

to easy.

---

<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:** [26 September 2020 14:00 UTC](https://discourse.nodered.org/t/modbus-data-correctly-read-out/32776/7 "2020-09-26T14:00:51Z")

</div>

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