TCP Read Function
- Updated2025-03-14
- 4 minute(s) read
Reads a number of bytes from a TCP network connection, returning the results in data out.

Inputs/Outputs
![]() mode indicates the behavior of the read operation.
![]() connection ID is a network connection refnum that uniquely identifies the TCP connection. ![]() bytes to read is the number of bytes to read. You must wire a value greater than 0 in order to read data from a network connection. The default is 0. Use one of the following techniques to handle messages that might vary in size:
![]() timeout ms specifies the time, in milliseconds, that mode waits before reporting a timeout error. The default is 25,000 ms. A value of –1 indicates to wait indefinitely. ![]() error in describes error conditions that occur before this node runs. This input provides standard error in functionality. ![]() connection ID out returns the same value as connection ID. ![]() data out contains the data read from the TCP connection. ![]() error out contains error information. This output provides standard error out functionality. |
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\Data Communication\Protocols\TCP\TCP Named Service\TCP Named Service.lvproj