MXSIO_Connect
Based on the COM port handle or ioLogik 2000 Ethernet module handle, users must use the function to establish an I/O device handle for each RS-485 or RS-232 I/O device. A COM port handle can connect one RS-232 I/O device or up to 64 RS-485 I/O devices.
C/C++
int MXSIO_Connect( int hCommport,
BYTE bytUnitID,
BYTE bytTransmissionMode,
int * hConnection);
Visual Basic
Declare Function MXSIO_Connect Lib "MXIO.dll" (ByVal hCommport As Long, ByVal bytUnitID As Byte, ByVal bytTransmissionMode As Byte, hConnection As Long) As Long
Arguments:
hCommport |
Connectting I/O Server via Serial interface will get a serial handle. Connectting I/O Server via Ethernet interface will get a Ethernet handle For more detail description please see the progam flow IV and program flow V. |
bytUnitID |
Modbus Unit ID of the RS-232 or RS-485 I/O Server. Ranging from 01 - 99. |
bytTransmissionMode |
Modbus transmission format. 0 RTU Transmission Mode 1 ASCII Transmission Mode Note that the protocol settings must agree with the hardware settings on ioLogik 4000 RS-485/232 I/O Server, and ioLogik 2000 only supports RTU |
hConnection |
Handle for the I/O device connection. |
Return Values :
Succeed |
MXIO_OK |
Fail |
Refer to Return Codes. |