read/write more than 256 registers at once
Hi,
If I want to read/write the values of more than 256 registers (e.g. 300 registers) starting at address 0 at once, are there any options I can set?
Thank you in advance :)
Hi. You can only write 123 holding registers with a single request (function 16). There is only 1 byte that defines the number of data bytes, so writing 300 16-bit registers is impossible. And most Modbus devices only allow you to write a few registers at a time to them, 8 or 16 isn't uncommon. But more modern devices can often support 100 registers or more.
But if you are talking about coils, the maximum should be 1968 coils written per request (function 15).
I have not checked what this library supports as maximum for each function, I just wanted to clarify that it's impossible to write 300 holding registers with a single request. You need to split it into several requests.