IPC@CHIP Modbus library – API Documentation

Header image

Main page


Modbus TCP server - Functions


Detailed Description

This page lists all functions of the Modbus TCP server API.
The library provides the creation of up to 16 servers listening on different TCP ports, specificable by a unique handle number.
Each server is able to serve up to 16 connections simultaneous.
Supported Modbus function codes: 1h,2h,3h,5h,6h,10h,17h

The application programmer has to implement/install several user-specific callback functions, which become executed on incoming Modbus master requests.

Note: Please use the provided source code sample TCP_SERVER as a template for the creation of own Modbus TCP server applications.
Enable debug mode: When setting the internal library variables mb_tcp_rcv_dbg and mb_tcp_snd_dbg to value 1 all incoming and outgoing messages are written to stdout.

Functions

int mbtcp_srv_init (MbHandle *handle, MBTCP_SRV_Init *initParams, int *errorCode)
 Initialize the MODBUS TCP server.
int mbtcp_srv_deinit (MbHandle handle)
 Stop and close Modbus TCP server.
int mbtcp_srv_get_socket (MbHandle handle)
 Gets the Modbus TCP server's listening socket descriptor.
int mbtcp_srv_loop (MbHandle handle, u16 delayMs)
 Modbus TCP server process loop.
int mbtcp_srv_loop_stop (MbHandle handle, u32 maxWaitMs)
 Stop Modbus TCP server process.





Top of page | Main page

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