No. Each command to an Item linked to Modbus channel enabled for writing causes a single write transaction.
ookay, so any command to these individual Items is going to produce a Modbus write.
The way the (shared) data Thing is configured as 32-bit, I would expect each write to be to the registers 16640 and 16641
So that should produce a write cycle to 16640 + 16641 with 32-bit value “0” expressed as two 16-bit registers.
Immediately followed by a separate write cycle to exactly the same register pair with a new value “XX”
I don’t know why you’re going at it this way. You’ve created a 32-bit data Thing, just assign that to one Number Item and use it. You don’t have to worry what goes on underneath.
You might be misunderstanding this. When you select an int32 write type, it is implicitly multiple - “32-bit” is just us all pretending to treat two 16-bit registers as a 32-bit value. So the parameter won’t even be used here, because we don’t refer to a Single register,
Many thanks. OK, I deleted the first sendcommand to 16640 in my rule and the rule is working. Basically I just don’t quite understand if I send xx to reg 16641 I would also need to write 0 to 16640. I think when I used MB Master software I had to write 0 to 16640 and xx to 16641. If I wrote xx only to 16641 it didn’t work.
This is in the setup page for the ModbusData Thing but I didn’t change the setting for this parameter.
It seems that I still have an issue with this ABB Terra EV charger. In MB reg 16416 is the connection timeout (in s). I use regular MB poll to read the content of this reg. The code for the MB data thing is:
This works and gives correct value but if I use int16 instead of uint16 then numbers above 32767 get negative, i.e. I would need to add 65536 to get the correct value. I’m running OH3.3.0 and I thought that uint is not permitted any more according to the release notes so I don’t quite understand why int16 is not working properly.
Yes, that’s working exactly as designed, that is the difference between uint16 and int16
You misunderstand, perhaps.
in your Modbus data Things, read and write types are designated separately.
So first up, if you want to read uint16, then choose uint16.
Secondly, there are long technical reasons why, but choice for write of int16/uint16 is actually immaterial, both would work exactly the same.
It’s because it is “you” (openHAB) supplying the number; command minus-1 or 34,000, the binding just makes it fit in 16 bits. So only one 16-bit option is available.