IPC@CHIP Modbus library – API Documentation

Header image

Main page

int mbTCP_cl_wr_coils ( MbHandle  handle,
u8  unitId,
u16  startAddress,
u16  quantity,
const u8 coilBuf,
u8 exception,
u32  timeoutMs,
int *  errorCode 
[in] handle : Handle returned by mbTCP_cl_init()
[in] unitId : Unit identifier
[in] quantity : Number of coils to write
[in] startAddress : Address of first coil
[in] coilBuf : Contains the coil values to write.
  The coils must be packed as one coil per bit of the buffer field.
  A logical '1' in a bit position of the field requests the corresponding output to be ON.
  A logical '0' requests it to be OFF.
[out] exception : Exception code (see ModbusExceptionCodes).
[in] timeoutMs : Wait max. timeout in [ms] for a reply.
[out] errorCode : TCP/IP Socket API error code
0 : Execution successful, check *exception for possible exception code.
-1: Timeout, no reply received
-2 : Received garbage (invalid Modbus frame data)
-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