Different read values between modbus scan and openhab modbus

Hello Community,

I am currently very actively excited and immersed with OpenHab.

I have encountered the problem that when reading with mod scan values from the modbus server it results (example): 37500.0000 (float32) and this is a correct value.

However, after configuring modbus in OpenHab, I am receiving the following value for the same value: 37376 (at the moment the decimals issue does not concern me … at the moment).

I attach the sequence of configuration of the Pol, Data … For my case it is holding register and floats 32.

Thanks.

I need the correct real value showed in Mod Scan.

As per the docs, try the float32swap version.

and/or

Be careful about register addressing conventions. First register in openHAB is designated “zero”, but in some device docs and some third party Modbus tools it will be designated “one” giving a “-1 offset” in addresses. It’s easy to get the wrong pair for a 32-bit.

Flotat32swap gives the result that the value is 0. I think the addresses are fine. I believe…

I’ve noticed that I had to shift registers by 1 compared to results given by mbpoll. This is quite famous issue of modbus itself. Try polling one register down or up and see if value is fine.

1 Like

@splatch @rossko57 You are indeed right. You have to match float 32 swapp and decrement one unit. This can be a confusing topic for other people. I understand that it depends on the implementation of the plugin, maybe big endian or little endian theme? I don’t know, I’m rambling.

Greetings and many thanks to both of you.

Yes, it is confusing. It depends on the target slave device designer andthe conventions they decided to follow, there is nothing we can do about that. The openHAB binding allows communication whatever is used by the slave, but requires manual configuration, which in turn requires understanding what is needed. That’s the hard part, won by experience and experiment.

1 Like