emelianov / modbus-esp8266

Most complete Modbus library for Arduino. A library that allows your Arduino board to communicate via Modbus protocol, acting as a master, slave or both. Supports network transport (Modbus TCP) and Serial line/RS-485 (Modbus RTU). Supports Modbus TCP Security for ESP8266/ESP32.
Other
497 stars 182 forks source link

readWriteHreg Illegal Address with more than 25 registers. #318

Closed matiasbarone closed 7 months ago

matiasbarone commented 7 months ago

I need to read/write many registers. When I use readWriteHreg and set more than 25 registers the callback function receives EX_ILLEGAL_ADDRESS What could be the problem, or what can I change in the configuration to avoid it?

Im using a ESP32S2 with arduino

matiasbarone commented 7 months ago

I found the problem, was all mine. I feel so noob.

The readValue and writeValue arrays were of 125 registers. And th offset in both cases were 100. If I make bigger the arrays or take the offset to 0 I can trasfer more bytes and no more illegal address