Page 1 of 1

02 illegal Data Address from Modbus Slave Example

Posted: Wed Jan 25, 2023 3:54 am
by chikichaka
I'm testing Modubs RTU example.
Whenever I tried to read Input Register value.
I can see 02 Illegal Data Address.

I'm using Modbus Poll window program to check Modbus communication.
other functions are working well such as Coils, Discrete Input, Holding Registers.

I use code from example here:

https://github.com/espressif/esp-idf/bl ... in/slave.c

Re: 02 illegal Data Address from Modbus Slave Example

Posted: Fri Jan 27, 2023 12:26 pm
by ESP_alisitsyn
@chikichaka ,

The slave configures two register areas for input registers:

Reg input area 1: 0, length: 8
Reg input area 2: 158, length: 8
Screenshot at 2023-01-27 13-31-03.png
Screenshot at 2023-01-27 13-31-03.png (43.77 KiB) Viewed 4885 times
Screenshot at 2023-01-27 13-18-33.png
Screenshot at 2023-01-27 13-18-33.png (44.97 KiB) Viewed 4881 times


If you configure Modbus poll to read these registers you will get the data correctly.
Screenshot at 2023-01-27 13-26-29.png
Screenshot at 2023-01-27 13-26-29.png (49.52 KiB) Viewed 4888 times

Re: 02 illegal Data Address from Modbus Slave Example

Posted: Sun Apr 13, 2025 1:46 pm
by suzan213
Hey, could you please send me a screenshot of your configuration? I'm working with the same code as you, but I'm not getting any results in Modbus Poll. Also, could you let me know what hardware you're using? That would really help. Thanks a lot!