TCP Write Function
- Updated2025-03-14
- 3 minute(s) read
Writes data to a TCP network connection.

Inputs/Outputs
![]() connection ID is a network connection refnum that uniquely identifies the TCP connection. ![]() data in contains the data you want to write to the connection. Use one of the following techniques to handle messages that might vary in size:
![]() timeout ms specifies the time, in milliseconds, for the function to write bytes to a device before the function completes and returns an error. The default value 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. ![]() bytes written is the number of bytes the VI writes to the 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