MXEIO_W5K_Connect
This function establishes a connection to the port of the Ethernet I/O device. Once a connection is established, a handle will be returned for additional functions.
C/C++
int MXEIO_W5K_Connect( char * szIP,
WORD wPort,
DWORD dwTimeOut,
int * hConnection,
char * szMACAddr);
Visual Basic
Declare Function MXEIO_W5K_Connect Lib "MXIO.dll" (ByVal szIP As String, ByVal iPort As Integer, ByVal nTimeOut As Long, handle As Long, ByVal szMACAddr As String) As Long
Arguments:
szIP |
IP address of the Ethernet I/O device to be connected.A-OPC Server IP address or ioLogik 5000 IP address |
wPort |
TCP port number of Ethernet I/O device. Please use 502 for ioLogik 5000 |
dwTimeOut |
Timeout value for establishing a network connection with the ioLogik Ethernet Adapter. The unit is in milliseconds. |
hConnection |
Handle for the I/O device connection. |
szMACAddr |
1. if szIP set to AOPC server IP address . The format like this 00-12-dd-23-78-a2 2. if szIP set to W5000 IP address. set to NULL |
Return Values :
Succeed |
MXIO_OK |
Fail |
Refer to Return Codes. |