# Convert 2 modbus words to float

**URL:** <https://discourse.nodered.org/t/convert-2-modbus-words-to-float/52229>\
**Category:** General\
**Tags:** modbus\
**Created:** [14 October 2021 20:35 UTC](https://discourse.nodered.org/t/convert-2-modbus-words-to-float/52229 "2021-10-14T20:35:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pautorras](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@pautorras](https://discourse.nodered.org/u/pautorras)\
**Post date:** [14 October 2021 20:35 UTC](https://discourse.nodered.org/t/convert-2-modbus-words-to-float/52229/1 "2021-10-14T20:35:11Z")

</div>

Hi folks,

I'm trying to convert 2 words in a ModbusTCP read, to a float value.  
Using node-red-contrib-buffer-parser, I'm not able to convert to float.

This is what I get in Modbus read:  
[16888, 1049]

I don't understand how to configure buffer parser node.

Help me please.

Thanks

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [14 October 2021 20:56 UTC](https://discourse.nodered.org/t/convert-2-modbus-words-to-float/52229/2 "2021-10-14T20:56:15Z")

</div>

Hello ..

If you wire a **complete msg Debug node** to the output of your Modbus-Flex-Getter  
you'll get a msg structured like below that includes the buffer data for Buffer-parser to use for the conversion

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/3136789dd8a118ed6d75f1f319e1120c20f93261.png)

Copy paste a sample of the data and tell us what real values it should be

---

<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:** [14 October 2021 21:00 UTC](https://discourse.nodered.org/t/convert-2-modbus-words-to-float/52229/3 "2021-10-14T21:00:10Z")

</div>

You can feed the 16bit integer values into buffer parser ...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/4/94d896ee1e138fa27965281fe0d479741ab8ef9e.png)

BUT, as @UnborN points out, you should use the actual buffer

Then configure the buffer parser as so...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b9d4b60d90aaeba013ed26cd42624cd84a1287d3.png)

* * *

be sure to read the built in help...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/1/210f95122dfe6affb63c2d00d763832730f77cc7.png)

---

<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:** [13 December 2021 21:00 UTC](https://discourse.nodered.org/t/convert-2-modbus-words-to-float/52229/4 "2021-12-13T21:00:45Z")

</div>

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