Modbus binding broken when writing to floating point registers

Been using the modbus binding (1.12.0.SNAPSHOT) for more than a year now with no issues, however I’m just now starting to send data the other way (OH2 writing data to the PLC, instead of just reading it).

I can write values to the PLC just fine if I use uint16 register types. However when the register is floating point, the PLC just gets senseless data (like 4.591846E -39 for example).

modbus config is like so:

# Outdoor Temp PLC

Trying to write decimal temperature values like 56.6 for example. They can be read from the PLC no problem, however writing values to the PLC doesn’t. Also, if I change length to just 1, the data the PLC gets is unchanged, making me think it’s not properly sending both registers.

well shit, just saw this in the modbus binding wiki:
“Note: The way Decimal commands are handled currently means that it is probably not useful to try to use Decimal commands with non-16bit valuetypes”

So I guess this is expected behavior. Any chance for a fix? I have a bunch of float values I need to write back to my PLC :slight_smile:


1 Like


Have a look at this link for a suggestion : Write Temperature Setpoint to Modbus as float32

Also, for the record, here is github issue regarding this behavior with the old binding

1 Like