# How to convert a 16-bit variable to 64-bit

**URL:** <https://discourse.nodered.org/t/how-to-convert-a-16-bit-variable-to-64-bit/13902>\
**Category:** General\
**Created:** [1 August 2019 17:57 UTC](https://discourse.nodered.org/t/how-to-convert-a-16-bit-variable-to-64-bit/13902 "2019-08-01T17:57:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eduardotodero](https://avatars.discourse-cdn.com/v4/letter/e/c89c15/32.png) [@eduardotodero](https://discourse.nodered.org/u/eduardotodero)\
**Post date:** [1 August 2019 17:57 UTC](https://discourse.nodered.org/t/how-to-convert-a-16-bit-variable-to-64-bit/13902/1 "2019-08-01T17:57:49Z")

</div>

Hello everyone, I am reading registers from a Siemens PAC2200 64 bit, how do I display this value correctly by node red? I need to join the 4-number vector to just one string.  
Thank you very much ![im1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a0ef9f6c769695d7633435d1f30fb36b428133af.png) ![im2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/abbee694e5f89eed72eee17bd7faea5936f92912.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:** [1 August 2019 18:59 UTC](https://discourse.nodered.org/t/how-to-convert-a-16-bit-variable-to-64-bit/13902/2 "2019-08-01T18:59:07Z")

</div>

You could look into type typed arrays or the [node.js buffer](https://www.w3schools.com/nodejs/ref_buffer.asp) as it has functions like readDoubleLE() and readDoubleBE().

Here is a [quick mock up](https://repl.it/@StephenMcLaughl/4intto64bit) using JS Typed Arrays (its a bit of a cludge but might be enough to nudge you in the right direction..

NOTE: you may have to swap your integers as I dont know endiannes of your data or how its stored in PLC or how the driver your're using handles the data bytes...
