I am a beginner with Node-Red and I would like to read the data of a meter via modbus and then display it in float format
With Modbus-Read node I'm getting this data:
How can I to convert in a float number like 407.555
thanks in advance for the help
Update 06/11/2021: I'tryng to convert the array recived from modbus but the result is wrong. I try tu use a function like this:
let pay = msg.payload;
const buf = Buffer.allocUnsafe(4);
buf.writeInt16BE(pay[0],2);
buf.writeInt16BE(pay[1],0);
msg.payload = buf.readFloatBE(0);
return msg;
In NodeRed if I add a debug I can read 0x1f85 0xb40
so is the same reading using a different modbus reader but the conversion in nodered with the function is 3.700156759202689e-32 and the value right is 2.18