Closed jmmgenerac closed 3 years ago
We will add REQ_WRITE_COUNT_MAX = 123 and adjust the write functions to use this a the default value.
I am not sure I understand the second bullet item, are you referring to a configuration point in pysunspec2?
Thanks, @bobfox. That will cover the need perfectly.
The Modbus specification states that the maximum number of registers returned from a Function 3 ("Read Holding Registers") or Function 4 ("Read Input Registers") is 125. And the number of registers for a Function 16 ("Write Multiple registers") is 123.
The pysunspec2 Modbus client only supports one value for the max register count. By default it is 125. Because there is only one value, this means that there is no way for the client to reach both limits of the standard at the same time.
Could the client be modified to comply with the standard? I think either of the following would be fine: