Bug: register_qty
do not works on the read_holding_registers()
#25
Labels
bug
Something isn't working
register_qty
do not works on the read_holding_registers()
#25
This bug was extracted from PR #10 report, in this reply:
The
register_qty
do not works on theread_holding_registers()
:>>> host.read_holding_registers(slave_addr=10, starting_addr=93, register_qty=1, signed=False) (19,) >>> host.read_holding_registers(slave_addr=10, starting_addr=93, register_qty=2, signed=False) (19,) <-- I believe that here should be (19, 786) - register address 93 and 94 >>> host.read_holding_registers(slave_addr=10, starting_addr=94, register_qty=2, signed=False) (786,) >>>
Using this register_definitions:
{'COILS': {'EXAMPLE_COIL': {'register': 123, 'len': 3, 'val': [1, 1, 1]}}, 'HREGS': {'EXAMPLE_HREG': {'register': 93, 'len': 4, 'val': 19}, 'EXAMPLE_HREG_2': {'register': 94, 'len': 2, 'val': 786}}, 'ISTS': {'EXAMPLE_ISTS': {'register': 67, 'len': 1, 'val': [1, 0, 0, 1]}}, 'IREGS': {'EXAMPLE_IREG': {'register': 10, 'len': 2, 'val': 60001}}}
Testing a different
register_definitions
model:If I change the register_definitions to this:
{'COILS': {'EXAMPLE_COIL': {'register': 123, 'len': 3, 'val': [1, 1, 1]}}, 'HREGS': {'EXAMPLE_HREG': {'register': 93, 'len': 1, 'val': [19, 23494]}}, 'ISTS': {'EXAMPLE_ISTS': {'register': 67, 'len': 1, 'val': [1, 0, 0, 1]}}, 'IREGS': {'EXAMPLE_IREG': {'register': 10, 'len': 2, 'val': 60001}}}
I have this results:
*1. The
register_qty
still not works, but when I try to read, address 93, 94 came together*2. When I try to read/write address 94, I have error
*3. When I try to write address 93, the value on address 94 is lost.
Well, in the second test I think that I broken the
register_refinitions
logic, but I do not know what is the correct rules for it. What is the correct usage on theregister definitions
?The text was updated successfully, but these errors were encountered: