IPC@CHIP Modbus library – API Documentation

Header image

Main page

int mbRTU_mst_rdwr_regs_packed ( MbHandle  handle,
u8  slaveAddr,
u16  startAddressRd,
u16  quantityRd,
u8 registerDataRd,
u16  startAddressWr,
u16  quantityWr,
const u8 registerDataWr,
u8 exception,
u32  timeoutMs 

Same as mbRTU_mst_rdwr_regs() but expects registerDataWr and returns registerDataRd in a packed manner.

[in] handle : Handle returned by mbRTU_mst_init()
[in] slaveAddr : Slave address
[in] startAddressRd : Address of the first register to read
[in] quantityRd : Number of registers to read
[out] registerDataRd : 16 bit buffer provided by user with min. length quantity
.   After execution registerDataRd contains the read register values   if *exception code==0.
  registerDataRd[0] == value of lowest register address,
  registerDataRd[quantityRd-1] holds highest register value.
[in] startAddressWr : Address of the first register (write)
[in] quantityWr : Number of registers to write
[in] registerDataWr : User provided storage, contains register values to write Need not to be aligned (i.e. packed)
[out] exception : Exception code (see ModbusExceptionCodes).
[in] timeoutMs : Wait max. timeout in [ms] for a reply from the slave.

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

Top of page | Main page

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