API  2.2
TSmarT Software Library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Port

Macros

#define MB_CDECL_SUFFIX
 Implementation of Write Single Register function. More...
 

Typedefs

typedef void * xMBPUDPHandle
 UDP porting layer instance handle.
 

Functions

SHORT vMBPInit (void)
 Porting initialization function. More...
 

Detailed Description

Macro Definition Documentation

eMBException MB_CDECL_SUFFIX

Implementation of Write Single Register function.

Implementation of Read exception status function.

Implementation of Diagnostics function.

Implementation of Read Device Identification function.

Implementation of Get Comm Event Log function.

Implementation of Get Comm Event Counter function.

Implementation of Report Slave ID function.

Implementation of Write Multiple Coils function.

Implementation of Write Single Coil function.

Implementation of Read Discrete Inputs function.

Implementation of Write Multiple Register function.

Parameters
pubMBPDUThe MODBUS protocol PDU which contains the MODBUS request.
pusMBPDULenThe length of the request in bytes.
pxMBSRegisterCBHandlers registered for Input/Holding/Discrete and Input registers.
Returns
eMBException::MB_PDU_EX_NONE if a response has been generated. Otherwise one of the exception codes.
Parameters
pubMBPDUThe MODBUS protocol PDU which contains the MODBUS request.
pusMBPDULenThe length of the request in bytes.
pxMBSRegisterCBHandlers registered for registers and status callbacks.
Returns
eMBException::MB_PDU_EX_NONE if a response has been generated. Otherwise one of the exception codes.

Function Documentation

SHORT vMBPInit ( void  )

Porting initialization function.

Initializes the ModBus stack porting layer. This function must be called prior to creating the TCP or RTU master/slave instances. To create the instances, see:

An example of ModBUS porting initialization within Init task:

* void vInitTask(void *param) {
* ...
* if (vMBPInit() != 0) {
* // Handle error
* }
* // Initialize RTU or TCP master/slave instances
* ...
* }
*
Returns
0 = Success, Otherwise = error
Examples:
modbus_master_rtu.c, and modbus_slave_rtu.c.