IPC@CHIP Modbus library – API Documentation

Header image

Main page

int mbRTU_mst_wr_single_reg ( MbHandle  handle,
u8  slaveAddr,
u8  functionCode,
u16  startAddress,
u16  registerData,
u8 exception,
u32  timeoutMs 

Send a "write single holding register" request 6h or 64h and receive reply from the slave.

[in] handle : Handle returned by mbRTU_mst_init()
[in] slaveAddr : Slave address
[in] functionCode : 06h or 64h
[in] startAddress : Address of the register
[in] registerData : 16 bit value to write
[in] timeoutMs : Wait max. timeout in [ms] for a reply from the slave
[out] exception : Exception code (see ModbusExceptionCodes).

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