Moxa IA3341-LX Инструкция по эксплуатации онлайн [71/72] 170917

Moxa IA3341-LX Инструкция по эксплуатации онлайн [71/72] 170917
IA3341 Linux User’s Manual Programmer’s Guide
6-16
Return:
0 for success and negative value for failure
-1 argument error
-2 memory allocation error
-3 failed to connect to MODBUS TCP server
Close MODBUS TCP connection and destroy connection handler
int mbtcp_disconnect(void *hndl);
Input:
<hndl> MODBUS TCP connection handler
Output: none
Return:
0 for success and negative value for failure
-1 argument error
Read register values via function code 3 or 4
int
mbtcp_read_regs(
void *hndl,
unsigned int tmout,
unsigned char reg_type,
unsigned short start_addr,
unsigned short count,
unsigned short reg_val[]
);
Input:
<hndl> MODBUS TCP connection handler
<tmout> communication timeout in second
<reg_type> register type for function code 3 or 4
3: read holding register
4: read input register
<start_addr> starting address
<count> quantity of registers
Output:
<reg_val> an array to hold register values, where the array size must be equal to
or greater than the requested quantity of registers.
Return:
0 for success, negative value for failure from API, and positive value for failure
from MODBUS TCP server
-1 argument error
-2 failed to send MODBUS TCP request to MODBUS TCP server
-3 failed to receive MODBUS TCP response from MODBUS TCP server
-4 disconnection from MODBUS TCP server
-5 illegal MODBUS TCP response message received
-6 unexpected MODBUS TCP response message received
1 bad function code
2 address out of range
3 bad read count
4 internal gateway failure
6 unable to accept the MODBUS request

Содержание

Похожие устройства

Скачать