Modbus Array Readings and Conversion


So modbus serial reader node reads in the data as one big array line, it reads it in as a in 16 type. My issue is that the registers on my device are both int 16 and IEEE754 float. I can`t find a way exactly to read the specific registers at their correct value. Only all in in16. What I would like to do is take this in16 bit data and convert it into the right reading for IEEE754.

I`m not sure exactly how to do that - any ideas anyone?

I haven't used it but I have seen node-red-contrib-buffer-parser recommended for such situations.

Hi Colin, thats the node I`m referring to, sadly the buffer parser takes the data and combines them into int 16 or at a certain length / offset the correct data type. Only problem is that its very difficult to locate the correct register. So ideally i want to take the buffer data in as all int16 and then convert the int 16 parts to the correct type myself.

So what exactly don't you know how to do? Convert two 16 bit ints to a float?

It does byte, 16 bit, 32 bit, 64 bit, float, whatever you want, single items or arrays, output as one object or individual items with topics. It literally does all the heavy lifting.

If you know the correct modbus register, it is very basic - please explain your issue.

buffer parser can do that too.

If you can do the following, I can show you exactly how to setup...

  1. provide a copy of the modbus output (using the copy button in the debug window)
  2. provide a spec (e.g.
    • bytes 0~3 are a float called "temperature" and should be 13.423
    • bytes 4~5 are an int16 called "lux" & should be 54
    • bytes 44~47 make a float called "3ph-voltage" and should contain 415.23
    • etc

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