# \[Announce\] node-red-contrib-bitunloader

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-bitunloader/19784>\
**Category:** Share Your Nodes\
**Created:** [31 December 2019 18:48 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-bitunloader/19784 "2019-12-31T18:48:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gemini86](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gemini86/32/70967_2.png) [@gemini86](https://discourse.nodered.org/u/gemini86)\
**Post date:** [31 December 2019 18:48 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-bitunloader/19784/1 "2019-12-31T18:48:44Z")

</div>

Officially announcing node-red-contrib-bitunloader! This is a tool that's useful for those who are working with integer values received from modbus or similar protocols. Pass in a value that is or can be parsed as an Integer and it will spit out the binary form of that number with a few different formats to choose from.

> **[node-red-contrib-bitunloader](https://flows.nodered.org/node/node-red-contrib-bitunloader)**
>
> Unload numbers to a binary string, array of bits, array of bools, object of bits, or object of bools.

---

<div class="post-metadata">

**Author:** ![intmech](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/intmech/32/18283_2.png) [@intmech](https://discourse.nodered.org/u/intmech)\
**Post date:** [11 March 2020 21:47 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-bitunloader/19784/2 "2020-03-11T21:47:49Z")

</div>

Bitunloader works beautifully to convert a number into an array of 16 bits but I need to find a node that can do exactly the opposite. What is the best way to convert an array of 16 bits into a number?

---

<div class="post-metadata">

**Author:** ![gemini86](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gemini86/32/70967_2.png) [@gemini86](https://discourse.nodered.org/u/gemini86)\
**Post date:** [12 March 2020 01:22 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-bitunloader/19784/3 "2020-03-12T01:22:26Z")

</div>

I'd look at either array.forEach() or array.reduce() to get a binary string that you could pass into parseInt() to get an integer number again. I've thought about adding a "reloader" node that could automatically handle this function. I'll look at it if I ever find the time!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 March 2020 09:24 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-bitunloader/19784/4 "2020-03-12T09:24:30Z")

</div>

Start with a value of zero, then loop through the array, most significant bit first, and for each one shift the accumulated value left one bit and add in the value from the array.

---

<div class="post-metadata">

**Author:** ![gemini86](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gemini86/32/70967_2.png) [@gemini86](https://discourse.nodered.org/u/gemini86)\
**Post date:** [30 March 2020 20:54 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-bitunloader/19784/5 "2020-03-30T20:54:50Z")

</div>

Hey there, thought I'd just let you know I've updated this to include a node for reversing the bitunloader node. It works using a couple properties passed from the bitunloader to tell it what to do, but you could also generate these yourself to use the bitreloader node stand-alone.

> **[node-red-contrib-bitunloader](https://flows.nodered.org/node/node-red-contrib-bitunloader)**
>
> Unload numbers to a binary string, array of bits, array of bools, object of bits, or object of bools.
