IPC@CHIP Modbus library – API Documentation

Header image

Main page


int mbtcp_srv_loop ( MbHandle  handle,
u16  delayMs 
)

This function executes cyclic at an endless loop:
1: Wait passive for client connection (with socket call accept())
2: Receive incoming Modbus requests and
3: calls the corresponding user-specific callback function (see mbtcp_srv_init()) and
4: sends the result (returned by the callback function) as a Mobus reply back to the master.

This function can be called as a Modbus TCP server at a separate task.
Calling mbtcp_srv_loop_stop() from outside of this task loop, will force an exit of the loop.

Parameters:
[in] handle,: Handle returned by mbtcp_srv_init()
[in] delayMs,: If delayMs!=0 this function sleeps delayMs milliseconds after each loop cycle.
Returns:
-2: Error: Invalid handle parameter
else 0 (when stopped by mbtcp_srv_loop_stop())





Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Thu Mar 9 18:00:33 2017 by Doxygen 1.6.1