Modbus binding - issue with writing 32-Bit values

Hello,

can anyone confirm that there is an issue with writing 32-Bit values via Modbus-binding in OH 1.8.2?

I have to write a uint32 into two holding registers (2x 16 bit) over (TCP) Modbus function code 0x10.
It is important that the write request for the two registers arrive the slave in one tcp packet!

My openhab modbus config looks like that:

modbus:writemultipleregisters=true

modbus:tcp.slave1.connection=192.168.x.x
modbus:tcp.slave1.type=holding
modbus:tcp.slave1.start=1
modbus:tcp.slave1.length=2
modbus:tcp.slave1.valuetype=uint32

Item config:
Number example "example [%d]" {modbus="slave1:0"}

For example: When I try to write the decimal value “196608” (bin 11 0000 0000 0000 0000) the tcp packet only contains a write request for the first register with the decimal value 0.
the second (expected) register, with the other 16 bits, are not sent. (captured with tcpdump)

Other example: I try to write the decimal value ‘3’ (11) the tcp packet also contains only one register. This request contains the vlaue ‘3’.

How are you setting the example value, maybe type casting needed there?

Hi rossko57,

I do it in the sitemap like that:

Switch item=example mappings=[0 = “off”, 65536 = “1”, 131072 = “2”, 196608 = “3”, 262144 = “4” ]

or for the other:

Switch item=example mappings=[0 = “off”, 1 = “1”, 2 = “2”, 3 = “3”, 4 = “4” ]