Closed frzifus closed 1 year ago
IMHO the point here is that the on/off values for the coils are non-obvious. Do they depend on modbus implementation's endianess? If not, the on/off values should be part of the api.
I agree, I'd rather not have to know this detail that on is 0xFF00 (I had to look this up right now). Maybe just take any nonzero value as on?
Do they depend on modbus implementation's endianess?
oh good question, will try to get that out.
Maybe just take any nonzero value as on?
Sounds fair to me.
What is missing to get coils support merged?
öhm, seems we're almost celebrating a one year anniversary. :partying_face: :balloon:
Do they depend on modbus implementation's endianess?
This is what modbus.org says about it:
4.2 Data Encoding • MODBUS uses a ‘big-Endian’ representation for addresses and data items. This means that when a numerical quantity larger than a single byte is transmitted, the most significant byte is sent first. So for example Register size value 16 - bits 0x1234 the first byte sent is 0x12 then 0x34
Other than that, i haven't found any further info during the last year.
Maybe just take any nonzero value as on?
Adapted it, now every value that is non-zero represents on
.
Recently used https://ozeki.hu/p_5880-mobdbus-function-code-5-write-single-coil.html. Seems we can acceppt any non-zero Value as "on", but devices will only ever accept/return 0xFF00
bigendian.
With this pr the modbus-cli tool is extended by the function
0x05
. This allows to switch individual outputs on and off.Usage:
Ref: https://ozeki.hu/p_5880-mobdbus-function-code-5-write-single-coil.html
Signed-off-by: Benedikt Bongartz benne@klimlive.de