Could not read float vlaues

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

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"[0],\n //"msg0":([1]>>16) +[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":"","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}]

Hi @Henri !
Welcome to this forum.

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


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

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

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

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.

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

@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.

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.

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

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)


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

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