Issue Reading Modbus Registers with Float conversion

Trying to read float energy values from power meter through modbus in Ignition OPC tags. Values on the meter don't match with values in Ignition. They are however close.

Modbus registers: As in vendor manual
modbus registers

Ignition: Results don't match with reading on meter.

Modbus scanner 1: Results don't match with reading on meter.

Modbus scanner 2: Results match with reading on meter.

Used 2 different modbus scanners, each yielding different results at different registers.

Using the following format OPC modbus tag format to read values:
active energy - IRF60
apparent energy - IRF62
reactive energy - IRF64

Does anybody know why Ignition does not read the actual values on the meter?
Appreciate help.

Regards,
Sameer

Have a look here, I believe that this might be what you are looking at.
Essentially a float is two words, and in certain instances if you are either word swapped or off by one register (generally caused by 0 based addressing) then you can get instances where you are looking at very similar data.

Try move your register address up by one or down by one and see if it affects it.
If that doesn't work, try setting the "Reverse Word Order" setting in the Modbus driver. Then try moving the address up or down one from the one in the manual and see if it fixes it, one of those will work I believe.

This is a byproduct of float not actually being part of the modbus standard, so there are a bunch of different ways people have used modbus to represent a float.

1 Like

Thanks @David_Stone

That worked like a charm. Had to reverse the byte ordering & add offset of 1 to the register to read correct values.

Regards
Sameer

You can also enable zero-based addressing (or disable one-based, forget what the setting is called), so your addresses match your documentation.