# ModBus TCP Read 32-bit registers

**URL:** <https://discourse.nodered.org/t/modbus-tcp-read-32-bit-registers/1710>\
**Category:** Industrial\
**Created:** [20 July 2018 02:17 UTC](https://discourse.nodered.org/t/modbus-tcp-read-32-bit-registers/1710 "2018-07-20T02:17:43Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![thatcadguy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thatcadguy/32/5273_2.png) [@thatcadguy](https://discourse.nodered.org/u/thatcadguy)\
**Post date:** [3 August 2019 22:58 UTC](https://discourse.nodered.org/t/modbus-tcp-read-32-bit-registers/1710/20 "2019-08-03T22:58:22Z")

</div>

@eduardotodero I usually create a new Uint16Array with the 16-bit values and then create a Float64Array with the Uint16Array's buffer:

```auto
var ui16a = new Uint16Array([1,2,3,4]); // your 16-bit integers here
var fl64a = new Float64Array(ui16a.buffer);
console.log(fl64a[0]);

```

Or, if you need more flexibility, get familiar with DataView, specifically you would end up using: [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/DataView/getFloat64](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat64)

Edit: missed if you were talking about 64-bit integers or floating-point numbers -- in any case, you can use typed arrays: [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed\_arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays) to do what you want. You may want to create a Int64Array, for example. With these, you can convert an entire block of a certain type in one shot.

---

_[View the full topic](https://discourse.nodered.org/t/modbus-tcp-read-32-bit-registers/1710)._
