alejoseb / Modbus-STM32-HAL-FreeRTOS

Modbus TCP and RTU, Master and Slave for STM32 using Cube HAL and FreeRTOS
GNU Lesser General Public License v2.1
560 stars 188 forks source link

can I set the retry times when the communication is lost ? #27

Closed houchaoo closed 3 years ago

houchaoo commented 3 years ago

it may be useful.

alejoseb commented 3 years ago

The retry option is not part of the Modbus master state diagram. Including it as part of the library will diverge from the standard. On the other hand, as part of the setup of the master you can implement the retry option wrapping the Modbus request in a for loop and handling the exceptions on each failed retry.

master