Moxa ioPAC 8020-5-M12-C-T [46/66] Mx_modbus_tcp_master_ioctl

Moxa ioPAC 8020-5-M12-C-T [46/66] Mx_modbus_tcp_master_ioctl
Developer's Guide for Moxa RTU Controllers Programmer's Guide
2-38
MX_Modbus_Tcp_Master_Ioctl
INT32 MX_Modbus_Tcp_Master_Ioctl(UINT32 sHandle, UINT8 unitId, UINT32 rwTimeoutMs);
This function configures the unit identifier and timeout values of the Modbus/TCP connection.
Input Parameters
sHandle
TCP connection handle
unitId
Unit identifier
rwTimeoutMs
timeout value in milliseconds
Output Parameters
None
Return Value
MODBUS_ERR_OK
MODBUS_ERR_LIB_INIT
MODBUS_ERR_PARAM
MODBUS_ERR_NOT_OPENED
MX_Modbus_Tcp_Master_Read_Coils
INT32 MX_Modbus_Tcp_Master_Read_Coils(UINT32 sHandle, UINT16 startAddr , UINT16
coilCount, UINT8 byteCoils[]);
This function performs Modbus function code 0x1; it reads multiple coils and puts the output in parameter
byeCoils.
Input Parameters
sHandle
TCP connection handle
startAddr
Modbus address
coilCount
The numbers of read coils
Output Parameters
byteCoils
This parameter holds the read coils value; users should provide enough buffer space. For
example, if coildCount=9, the buffer size of byteCoils should be at least 2 bytes.
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_RESP
MODBUS_ERR_TIMEOUT
MODBUS_ERR_SOCKET

Содержание

Скачать