XPS Unified Programmer’s Manual
7.2.1.326 TCP_ConnectToServer
Name
TCP_ConnectToServer – Sets TCP/IP communication and opens a socket.
Input tests
- Refer to section 7.1: “Input Tests Common to all XPS Functions”.
- Checks number of used sockets (Max = 100): if no free socket then the SocketID is
set to -1.
Description
Configures the TCP/IP communication and opens a socket to connect TCP server.
This function returns a socket identifier to use for each function call. The socket
identifier is defined between 0 to 99. If the TCP/IP connection failed then the
“SocketID” value is –1.
NOTE
OpenConnection function is used when users are in local mode, it only needs the
timeout and socket number to open the connection with the XPS controller.
TCP_ConnectToServer function needs more information like the port number and
the IP address. This function is called with the DLL.
Prototype
int TCP_ConnectToServer(
char * IP_Address,
int IP_Port,
double TimeOut
)
Input parameters
IP_Address char * TCP IP address: 195.168.33.xxx or another.
IP_Port int TCP IP port: 5001 for XPS controller.
TimeOut double Timeout in seconds used for each.
function execution.
Output parameters
None.
Return (In addition to the results of “Input Tests Common to all XPS
Functions”)
SocketID int Socket identifier used in each function.
475 EDH0373En1023 — 01/18