# Could not read float vlaues

**URL:** <https://discourse.nodered.org/t/could-not-read-float-vlaues/75801>\
**Category:** Industrial\
**Created:** [27 February 2023 09:08 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801 "2023-02-27T09:08:28Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henri](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@Henri](https://discourse.nodered.org/u/Henri)\
**Post date:** [27 February 2023 09:08 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801/1 "2023-02-27T09:08:28Z")

</div>

Hello,  
i am new in node-red. i am reading meter values (floating). but i got stucked.  
please help me.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/d/7d1c18b217223e9ff9b7573db989722d75f71778.png)

my code is

[{"id":"aec06046.b9d77","type":"modbus-read","z":"ca242bfe.757a08","name":"","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"1","dataType":"HoldingRegister","adr":"10","quantity":"1","rate":"5","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"2a2377f0.2b85b8","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":150,"y":220,"wires":[["2b690201c6ec9725"],]},{"id":"2b690201c6ec9725","type":"function","z":"ca242bfe.757a08","name":"modbus data","func":"\nmsg.payload = {\n "msg0" :msg.payload.data[0],\n //"msg0":(msg.payload.data[1]\>\>16) + msg.payload.data[0],\n};\n \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":390,"y":220,"wires":[["dfb04119cbbb73a8"]]},{"id":"dfb04119cbbb73a8","type":"debug","z":"ca242bfe.757a08","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":700,"y":240,"wires":},{"id":"2a2377f0.2b85b8","type":"modbus-client","name":"Device\_IP","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit\_id":"1","commandDelay":"2000","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]

---

<div class="post-metadata">

**Author:** ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)\
**Post date:** [27 February 2023 09:20 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801/2 "2023-02-27T09:20:59Z")

</div>

Hi @Henri !  
Welcome to this forum.

So - what's the problem you're struggling with?

---

<div class="post-metadata">

**Author:** ![Henri](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@Henri](https://discourse.nodered.org/u/Henri)\
**Post date:** [27 February 2023 09:27 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801/3 "2023-02-27T09:27:31Z")

</div>

hii!

actually i need to read floating value from meter. but could not read floating value. if i am trying to read signed values i read proper way there is no problem

---

<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:** [27 February 2023 09:28 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801/4 "2023-02-27T09:28:59Z")

</div>

You should be able to use node-red-contrib-buffer-parser for this. It is designed for exactly this sort of problem.

---

<div class="post-metadata">

**Author:** ![Henri](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@Henri](https://discourse.nodered.org/u/Henri)\
**Post date:** [27 February 2023 09:31 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801/5 "2023-02-27T09:31:05Z")

</div>

> [@Colin](#):
>
> node-red-contrib-buffer-parser

hii Colin,  
thanks for replay !!

i tried to use node-red-contrib-buffer-parser but from meter i got 25 values and in node-red-contrib-buffer-parser i could not read all the values

---

<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:** [27 February 2023 09:36 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801/6 "2023-02-27T09:36:05Z")

</div>

> [@Henri](#):
>
> in node-red-contrib-buffer-parser i could not read all the values

In that case you have not configured the node correctly. Did you look at the examples that come with it?

If you can't make it work then show us what is in the buffer you are feeding to it (use the Copy Value button from the debug pane to copy it, and paste it here, and show us how you have configured the node. I am not the expert in using that node, so actually you might be better closing this thread and starting a new one specifically for asking for help with node-red-contrib-buffer-parser, and paste the data into that thread, along with how you have configured the node.

---

<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:** [27 February 2023 10:27 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801/7 "2023-02-27T10:27:20Z")

</div>

> [@Henri](#):
>
> i tried to use node-red-contrib-buffer-parser but from meter i got 25 values and in node-red-contrib-buffer-parser i could not read all the values

buffer-parser is exactly the node you need. What did you do and what did you see.

As colin has suggested, we will need a capture of your data (use a debug node to capture the response from the modbus node) AND we will need an idea of the values you expect out of the buffer-parser

---

<div class="post-metadata">

**Author:** ![Henri](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@Henri](https://discourse.nodered.org/u/Henri)\
**Post date:** [27 February 2023 11:23 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801/8 "2023-02-27T11:23:22Z")

</div>

> [@Steve-Mcl](#):
>
> buffer-parse

@Steve-Mcl , @Colin thanks for replay.  
I got the floating values but now i try to get Timestamp also. can you help me out to getting timestamp with the help of node-red-contrib-buffer-parser.

---

<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:** [27 February 2023 11:30 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801/9 "2023-02-27T11:30:56Z")

</div>

> [@Henri](#):
>
> can you help me out to getting timestamp with the help of node-red-contrib-buffer-parser.

Not unless you provide demo data (as described previously) and tell us where in that data the date value is and what you expect it to be.

---

<div class="post-metadata">

**Author:** ![Henri](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@Henri](https://discourse.nodered.org/u/Henri)\
**Post date:** [27 February 2023 11:54 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801/10 "2023-02-27T11:54:50Z")

</div>

hello, for time stamp i need to show graph that is why i need time stamp.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/a/cac107d1e106421aa7ccfe89b4e00b4715e215eb.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:** [27 February 2023 12:43 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801/11 "2023-02-27T12:43:45Z")

</div>

we cannot do anything with a picture. You will need to export demo flow (CTRL-E) and paste it in a code block

`````  
`like this (with backticks above and below the exported flow)`  
`````

EDIT...

Is the timestamp coming from PLC (and you need to convert data to proper timestamp)  
OR  
Do you simply want a timestamp added by node-red when the data is read?

---

<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:** [28 April 2023 12:43 UTC](https://discourse.nodered.org/t/could-not-read-float-vlaues/75801/12 "2023-04-28T12:43:48Z")

</div>

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