IPC@CHIP Modbus library – API Documentation

Header image

Main page

MBTCP_SRV_Init Struct Reference
[Modbus - Data types]

Modbus server TCP initialization parameters. More...

Detailed Description

Modbus TCP server initialization struct, required by mbtcp_srv_init().
For initialization of the Modbus tcp server application the user has to initialize a variable of the following type with valid values.

See also:
Important parts of this structure are function pointers for Modbus device specific callback functions provided by the user.
These functions are executed at mbtcp_srv_loop(), if a valid master request was received.
After execution the return results (success, data, exception code) are replied back to master.
Functions, which shall be not supported, must be set to NULL.
See also example code TCP_SERVER.

Data Fields

u16 port
int keepalive_enable
int tcp_keepalive_time
int tcp_keepalive_intv
int tcp_keepalive_cnt
int(* mbtcp_srv_rd_regs )(u8 unitID, u8 functionCode, u16 startAddress, u16 quantity, void *regBuf, u8 *byteCount)
int(* mbtcp_srv_wr_regs )(u8 unitID, u16 startAddress, u16 quantity, const void *regBuf, u16 *quantityOutputsWritten)
int(* mbtcp_srv_rdwr_regs )(u8 unitID, u16 startAddressRd, u16 quantityRd, void *regBufRd, u8 *byteCountRd, u16 startAddressWr, u16 quantityWr, const void *regBufWr, u16 *quantityOutputsWritten)
int(* mbtcp_srv_wr_singleReg )(u8 unitID, u16 startAddress, u16 outputValue, u16 *outputValueWritten)
int(* mbtcp_srv_rd_bits )(u8 unitID, u8 functionCode, u16 startAddress, u16 quantityInputs, u8 *inpBuf, u8 *byteCount)
int(* mbtcp_srv_wr_singleCoil )(u8 unitID, u16 startAddress, u16 outputValue, u16 *outputValueWritten)
int(* mbtcp_srv_wr_coils )(u8 unitID, u16 startAddress, u16 quantityOutputs, u8 byteCount, const u8 *outBuf, u16 *quantityOutputsWritten)

Top of page | Main page

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