MODBUS TCP/IP issue

sabin.john
Posts: 7
Joined: Thu Dec 03, 2020 11:53 am

MODBUS TCP/IP issue

Postby sabin.john » Sat Feb 13, 2021 12:57 pm

Hello,
I am currently facing an issue with the ESP-IDF v4.3-dev-1901-g178b122c1
We are running a modbus tcip project. The ESP board acts as a client and on the other side is a Schneider electric PLC model no TM172PBG28R. When the client polls the plc for data, no response is being received by the ESP. The request are being timed out at the client end and the next requests are sent.
Interestingly if we connect the esp as client via Ethernet to MODSIM on PC, the request and response cycle works. And if we connect the PLC via Ethernet to MODSCAN on PC, then also request response cycle works correctly. Very peculiar issue that I am unable to pinpoint. Has anyone else faced a similar issue? Are there any possible solutions I can try?

ESP_alisitsyn
Posts: 211
Joined: Fri Feb 01, 2019 4:02 pm
Contact:

Re: MODBUS TCP/IP issue

Postby ESP_alisitsyn » Tue Feb 16, 2021 2:01 pm

Hello @sabin.john,

The timeout error on client side can be happened due to respond timeout from your server side. The ESP master configured to wait response during CONFIG_FMB_MASTER_TIMEOUT_MS_RESPOND milliseconds and drop any response data received from the server side after timeout (corresponding field MBAP.TID is checked to reliably drop only required response). If other tasks in your software with higher priority suspend the Modbus master tasks often it can cause data processing latency and can cause the timeout. The CONFIG_FMB_PORT_TASK_PRIO kconfig value can be used to adjust the processing time.

Could you provide more information about your project that would help to recognize the issue?
1. Could you send the code of ESP32 client side or at least master data dictionary (device_parameters) to read your holding registers from PLC side.
2. Do you have any other WiFi or NVS related tasks which disable CPU cache?
3. Please set Default log verbosity to Debug in the Component config - > Log Output kconfig menu and then recompile example then repeat the connection to PLC side then save communication log from client side and send it to me.

Thanks.

ESP_alisitsyn
Posts: 211
Joined: Fri Feb 01, 2019 4:02 pm
Contact:

Re: MODBUS TCP/IP issue

Postby ESP_alisitsyn » Tue Feb 23, 2021 3:40 pm

For the information: the related or the same issue resolved: https://github.com/espressif/esp-idf/issues/6534

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 347 guests