# Modbus TCP 32 bits register from 16 bits register

**URL:** <https://discourse.nodered.org/t/modbus-tcp-32-bits-register-from-16-bits-register/23597>\
**Category:** General\
**Created:** [25 March 2020 07:01 UTC](https://discourse.nodered.org/t/modbus-tcp-32-bits-register-from-16-bits-register/23597 "2020-03-25T07:01:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveMou](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@DaveMou](https://discourse.nodered.org/u/DaveMou)\
**Post date:** [25 March 2020 07:01 UTC](https://discourse.nodered.org/t/modbus-tcp-32-bits-register-from-16-bits-register/23597/1 "2020-03-25T07:01:27Z")

</div>

Hi guys,  
I have an Schneider Energy Meter PM5110 and some registers are float 32 bits. I read all of them with modbus poll .  
I have read them with node red but I have two 16 bits registers. Attached I try to read the frequency (50Hz). I read two 16 bits registers but I don´t know how I can convert this array to the result that I want to read (50 Hz). Attached the voltage as well. I have this problem with all 32 bits registers.  
Any idea? Thank you very much for your support.

 ![Frequency](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/7/171d9a63c0780ceaa102b999ea677783df3813e7.png) ![Voltage](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/78e2678529db12b6adadbb670f0c1f7e081e06a3.png)

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [25 March 2020 09:51 UTC](https://discourse.nodered.org/t/modbus-tcp-32-bits-register-from-16-bits-register/23597/2 "2020-03-25T09:51:36Z")

</div>

Hi,  
Try this node

> **[node-red-contrib-float](https://flows.nodered.org/node/node-red-contrib-float)**
>
> Node-RED node to parse decimal and binary numbers to IEEE-754 Floating Point Numbers

---

<div class="post-metadata">

**Author:** ![DaveMou](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@DaveMou](https://discourse.nodered.org/u/DaveMou)\
**Post date:** [25 March 2020 10:12 UTC](https://discourse.nodered.org/t/modbus-tcp-32-bits-register-from-16-bits-register/23597/3 "2020-03-25T10:12:17Z")

</div>

thank you edje11, but if I use that node and I suppose I have to do anything else, does it?  
Thank you.

 ![Float](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/b/8b41a74c3caf55893c4269d64aa7c5a7b95a2ab8.png)

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [25 March 2020 10:34 UTC](https://discourse.nodered.org/t/modbus-tcp-32-bits-register-from-16-bits-register/23597/4 "2020-03-25T10:34:33Z")

</div>

![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/f/1fd4e8dc8fd694b2b1ba1a09e81040e6701d06f5.png)

Place a function node in front of the ToFloat with;

```auto
msg.payload = (msg.payload[0] << 16) + msg.payload[1]
return msg;

```

---

<div class="post-metadata">

**Author:** ![DaveMou](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@DaveMou](https://discourse.nodered.org/u/DaveMou)\
**Post date:** [25 March 2020 10:50 UTC](https://discourse.nodered.org/t/modbus-tcp-32-bits-register-from-16-bits-register/23597/5 "2020-03-25T10:50:27Z")

</div>

> [@edje11](#):
>
> msg.payload = (msg.payload[0] \<\< 16) + msg.payload[1] return msg;

thank you very much!!

---

<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:** [24 May 2020 10:50 UTC](https://discourse.nodered.org/t/modbus-tcp-32-bits-register-from-16-bits-register/23597/6 "2020-05-24T10:50:35Z")

</div>

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