# How to read a 33-bit field with "node-red-contrib-binary"?

**URL:** https://discourse.nodered.org/t/how-to-read-a-33-bit-field-with-node-red-contrib-binary/57483
**Category:** General
**Created:** [30 January 2022 07:07 UTC](https://discourse.nodered.org/t/how-to-read-a-33-bit-field-with-node-red-contrib-binary/57483 "2022-01-30T07:07:05Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [30 January 2022 08:38 UTC](https://discourse.nodered.org/t/how-to-read-a-33-bit-field-with-node-red-contrib-binary/57483/2 "2022-01-30T08:38:23Z")

</div>

Easy enough with buffer parser node.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/a/5ae0de004748ae49939d07ab9ae42bdcfd901d24.png)

```auto
[{"id":"af1d307c4cb20277","type":"buffer-parser","z":"85e1791bc0cd6285","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"bigint64be","name":"MASK_00000001FFFFFFFF","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":"0x00000001FFFFFFFF"},{"type":"bigint64be","name":"MASK_000001FFFFFFFFFF","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":"0x000001FFFFFFFFFF"},{"type":"bigint64be","name":"MASK_0001FFFFFFFFFFFF","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":"0x0001FFFFFFFFFFFF"},{"type":"bigint64be","name":"MASK_000FFFFFFFFFFFFF","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":"0x000FFFFFFFFFFFFF"},{"type":"bigint64be","name":"NO_MASK","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"return","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":2170,"y":140,"wires":[["8c178d9160e32087"]]},{"id":"9f6b3d376054a695","type":"inject","z":"85e1791bc0cd6285","name":"0x000FFFFFFFFFFFFF (4503599627370495)","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[0,15,255,255,255,255,255,255, 0,0,0,128,0,0,51 , 0,0,0,0,129,5,5,1]","payloadType":"bin","x":2070,"y":80,"wires":[["af1d307c4cb20277"]]},{"id":"8c178d9160e32087","type":"debug","z":"85e1791bc0cd6285","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2170,"y":200,"wires":[]}]

```

NOTE: This makes use of `BigInt` type. Your node-js version must be V10.4.0 or greater.  
NOTE2: As the result is a BigInt, you might need to change it to a `number` type (easy in a function node with `msg.payload.NO_MASK = Number(msg.payload.NO_MASK);`)

---

_[View the full topic](https://discourse.nodered.org/t/how-to-read-a-33-bit-field-with-node-red-contrib-binary/57483)._
