# TCPClient

The TCPClient function is used to define a spreadsheet cell as a TCP/IP client, which initiates the communication with another TCP/IP device for sharing data over the network.

Note:

- Only one TCPClient function is allowed in the spreadsheet; otherwise, the TCPClient function will return #ERR.
- The connection between TCP/IP devices will start immediately when the TCPClient function is added or the job is loaded to the spreadsheet.
- The ReadDevice function is not supported by the current release.

## TCPClient Inputs

Parameter | Description
Host Name | Specifies the name or the IP address of the TCP device with which to establish a connection. If the host name is not specified, the TCPClient function will return an #ERR.
Port Number | Specifies the port number (default = 3000) at which the connection will be established between TCP/IP devices. Note: The port number entered here must also be assigned on the server.
Packet Type | Defines the formatting of the data string communicated between TCP/IP devices. 3 = String Nullchar (0) ASCII format. When a TCP/IP device is sending, the ASCII character 0 (Nullchar) will be appended to the data string.
Timeout | The number of milliseconds (1000 to 15000; default = 1000) to wait for a TCP/IP connection to be established before aborting the connection attempt. Note: Only a granularity of seconds is supported. The number of milliseconds entered will be rounded to the nearest second. If the timeout period is exceeded, the TCPClient function will not return an #ERR. Instead, the #ERR will be returned by the WriteDevice function.
Terminator | Custom terminator is not supported by the current release.

## TCPClient Outputs

Returns | A Device data structure. Returns #ERR if any of the input parameters are invalid, or when the Timeout is exceeded.
Results | A WriteDevice function will be automatically inserted in the adjacent cell to the right, when the TCPClient function is inserted into a cell.