IPC@CHIP Modbus library – API Documentation

Header image

Main page

MBRTU_SLV_Init Struct Reference
[Modbus - Data types]

Modbus RTU slave initialization parameters. More...

Detailed Description

Modbus RTU slave initialization struct, required by mbRTU_slv_init().
For initialization of the Modbus RTU slave application the user has to initialize a variable of the following type with valid values.

See also:
An important part of this structure are function pointers for Modbus device specific callback functions provided by the application programmer.
These functions are executed at mbRTU_slv_loop(), if a valid master request was received.
After execution of the callback function the return results (success, data, exception code) are replied back to master.
Functions, which shall be not supported, must be set to NULL.
For correct usage see example source code MBRTU_SLAVE.

Data Fields

int port
u32 baud
int parity
int rtuMode
u8 slaveAddress
u16 bcastAddress
int(* mbslv_rd_regs )(u8 functionCode, u16 startAddress, u16 quantity, void *regBuf, u8 *byteCount)
int(* mbslv_wr_regs )(u16 startAddress, u16 quantity, const void *regBuf, u16 *quantityOutputsWritten)
int(* mbslv_rdwr_regs )(u16 startAddressRd, u16 quantityRd, void *regBufRd, u8 *byteCountRd, u16 startAddressWr, u16 quantityWr, const void *regBufWr, u16 *quantityOutputsWritten)
int(* mbslv_wr_singleReg )(u16 startAddress, u16 outputValue, u16 *outputValueWritten)
int(* mbslv_rd_bits )(u8 functionCode, u16 startAddress, u16 quantityInputs, u8 *inpBuf, u8 *byteCount)
int(* mbslv_wr_singleCoil )(u16 startAddress, u16 outputValue, u16 *outputValueWritten)
int(* mbslv_wr_coils )(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