IPC@CHIP Modbus library – API Documentation

Header image

Main page


int mbRTU_mst_WrRd_ByteBlock ( MbHandle  handle,
u8  slaveAddr,
u16  startAddress,
const u8 sendBuf,
u16  sendNumBytes,
u8 replyBuf,
u16 replyLength,
u16  expectedReplyLength,
u8 exception,
u32  timeoutMs 
)

Beck IPC specific:
Send a "write/read byte block" request with user defined function code 65 and receive the reply from the slave.

Parameters:
[in] handle : Handle returned by mbRTU_mst_init()
[in] slaveAddr : Slave address
[in] startAddress : Address of the first register
[in] sendBuf : Storage of bytes to send
[in] sendNumBytes : Number of bytes to write
[out] replyBuf : User provided storage( with length 256!), contains reply of the slave.
[out] replyLength : Contains number of bytes, replied by the slave
[in] expectedReplyLength : The expected number of bytes to receive from the slave
[out] exception : Exception code (see ModbusExceptionCodes)
[in] timeoutMs : Wait max. timeout in [ms] for a reply from the slave
Returns:

0 : Execution successful, check *exception for possible exception code.
-1 : Communication timeout receive
-2 : Received garbage (CRC error)
-3 : Unable to send request
-8 : Illegal parameter port





Top of page | Main page

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