Reading 32 bit Float from modbus TCP using node red

how to read modbus TCP holding values (03) – 32bit float word swap (CD AB) with node red function block ?

I have problem with modbus…

Reading from modbus TCP ( FC3 , data size 32 bit Float, address 272 decimal)…

When Node RED read values ( FC 3, read holding registers, quantity 2 ) returns values like [0,16833] … Here I’m using msg.payload=msg.payload[1] in function to get value 16833 out from array…

This is my temperature sensor value..

To see if modbus address is correct I’m using external app to read values from sensors ( Rilheva modbus poll ) …

Correct value is reading from PLC module when is set to :

Read holding values (03) – 32bit float word swap (CD AB) – see screen…

So, does anybody knows how to convert it to real value – here it is 24.25…

Read more here: Source link