IPC@CHIP Modbus library – API Documentation

Header image

Main page

int mbTCP_cl_rd_regs ( MbHandle  handle,
u8  unitId,
u8  functionCode,
u16  startAddress,
u16  quantity,
u16 registerData,
u8 exception,
u32  timeoutMs,
int *  errorCode 

Send a "read multiple registers" request 03h or 04h and receive the reply from the server.

[in] handle : Handle returned by mbTCP_cl_init()
[in] unitId : Unit identifier
[in] functionCode : 03h or 04h
[in] startAddress : Address of first register
[in] quantity : Number of registers to read
[out] registerData : User provided storage, contains register values
[in] timeoutMs : Wait max. timeout in [ms] for a reply.
[out] exception : Exception code (see ModbusExceptionCodes).
[out] errorCode : TCP/IP Socket API error code
0 : Execution successful, check *exception for possible exception code.
-1 : Timeout
-2 : Received garbage (invalid Modbus frame data)
-4 : Illegal function code
-5 : TCP socket fault, see errorCode

Top of page | Main page

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