IPC@CHIP Modbus library – API Documentation

Header image

Main page


int mbtcp_srv_init ( MbHandle handle,
MBTCP_SRV_Init initParams,
int *  errorCode 
)

Initialize the MODBUS TCP server.
The provided settings of the caller are internally stored and used for the Modbus TCP communication.
For usage please see also example code of TCP_SERVER, file main.c

Parameters:
[out] handle : Handle that must be passed to other functions
[in] initParams,: Points to a user defined structure variable of type MBTCP_SRV_Init, which contains all required initialization data and the modbus callback function pointers.
[out] errorCode,: Storage contains RTOS TCPIP Socket API error code
Returns:
>=0 : Success, the returned number must be used as a connection handle for all other server functions e.g. mbtcp_srv_deinit() or mbtcp_srv_loop().

-1 : Failed
-4 : Socket open fault
-5 : Socket option fault
-6 : Socket bind fault
-7 : Socket listen fault
-8 : Server port already in use
MB_OUT_OF_MEMORY : Out of memory






Top of page | Main page

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