This function executes cyclic at an endless loop:
1: Waits for incoming Modbus master request and
2: calls the corresponding user-specific callback function (see mbRTU_slv_init()) and
3: sends the result (returned by the callback function) as a Modbus reply
back to the master.
This function can be called as Modbus slave service at a separate task. Calling mbRTU_slv_loop_stop() from outside of the task will force an exit of the loop.
|[in] ||handle ||: Handle returned by mbRTU_slv_init() |
|[in] ||delayMs,: ||Number of milliseconds the task will sleep after each loop.|
-2: Invalid port parameter
else 0 (if stopped by mbRTU_slv_loop_stop())