Does TCP Write VI Adds CR, LF Or End Of Line Characters By Default?

Updated Dec 18, 2023

Reported In

Software

  • LabVIEW

Issue Details

I'm implementing custom TCP protocol to communicate with a third-party device and It doesn't work as I expected. Does TCP Write function adds any of Carriage Return (CR), Line Feed (LF) or End of Line characters by default?

Solution

No, TCP Write Function writes data to a TCP network connection, where data strictly equals to bytes in "data in" cluster.

Additional Information

The problem may be in TCP protocol itself, so you need to choose and implement a suitable TCP/IP protocol communication.
First of all, you can try to use one of the following techniques to handle messages:
  • Send messages that are preceded by a fixed size header that describes the message
  • Make each message a fixed size
  • Send messages that are strictly ASCII in content, where each message is terminated by a carriage return and linefeed pair of characters
More details can be found in TCP Write Function help page .