2 setting the ethernet port, 1 startsocket, 2 connectsocket – INFICON XTC/3 Thin Film Deposition Controller Communications Library Operating Manual User Manual

Page 18

Advertising
background image

1 - 4

IP

N 07

4-

45

4-

P1

B

XTC/3 Communications Library Operating Manual

1.2.2 Setting the Ethernet Port

The following functions must be called sequentially - in the order of StartSocket,
ConnectSocket - to open an Ethernet port. The port must be closed prior to exiting
the application by using the CloseSocket function.

1.2.2.1 StartSocket

int StartSocket();

Description

This function, which opens a socket on the Ethernet port, needs to be called
only once (at the beginning of the application, for example).

Arguments

None

Returns

If the port is successfully opened, a TC_E_SUCCESS value is returned.

A TC_ERROR is returned if the port in question can not be opened.

TC_E_PORT_UNAVAILABLE is returned if the port is being used by another
application, such as HyperTerminal, for example.

1.2.2.2 ConnectSocket

BOOL ConnectSocket(char* host);

Description

This function connects the socket to the host. After determining an IP address
for the XTC/3, in the form of XXX.XXX.XXX.XXX, this function is called using
that address as the host. This function also creates the socket if it does not exist
when called.

Arguments

char* host:

The IP Address in the form of XXX.XXX.XXX.XXX

Returns

If the socket is successfully connected then a TRUE is returned.

If the socket is not connected then a FALSE is returned.

Advertising