Moxa ioPAC 8500-5-RJ45-C-T [47/66] Mx_modbus_tcp_master_write_coil

Moxa ioPAC 8500-2-M12-C-T [47/66] Mx_modbus_tcp_master_write_coil
Developer's Guide for Moxa RTU Controllers Programmer's Guide
2-39
MX_Modbus_Tcp_Master_Write_Coils
INT32 MX_Modbus_Tcp_Master_Write_Coils(UINT32 sHandle, UINT16 startAddr , UINT16
coilCount, UINT8 byteCoils[]);
This function performs Modbus function code 0xF; it writes multiple coils, and the coils value should be put in
parameter byteCoils in bit-map format
Input Parameters
sHandle
TCP connection handle
startAddr
MODBUS address
coilCount
The numbers of coils.
byteCoils
User should put coils value in bit-map format.
Output Parameters
None
Return Value
Modbus standard error codes are mapped to values 16 to 24. Refer to the header file libmoxa_pgm.h.
MODBUS_ERR_OK
MODBUS_ERR_LIB_INIT
MODBUS_ERR_PARAM
MODBUS_ERR_NOT_OPENED
MODBUS_ERR_SOCKET
MODBUS_ERR_TIMEOUT
MODBUS_ERR_RESP
MX_Modbus_Tcp_Master_Write_Coil
INT32 MX_Modbus_Tcp_Master_Write_Coil(UINT32 sHandle, UINT16 addr , UINT8 coil);
This function performs Modbus function code 0x5; it writes a single coil.
Input Parameters
sHandle
TCP connection handle
addr
Modbus address
coil
coil value: 0 or 1
Output Parameters
None
Return Value
Modbus standard error codes are mapped to values 16 to 24. Refer to the header file libmoxa_pgm.h.
MODBUS_ERR_OK
MODBUS_ERR_LIB_INIT
MODBUS_ERR_PARAM
MODBUS_ERR_NOT_OPENED
MODBUS_ERR_SOCKET
MODBUS_ERR_TIMEOUTMODBUS_ERR_RESP

Содержание

Скачать