Carriage Return, Line Feed, and End of Line Constants in LabVIEW

Updated Nov 13, 2019

Reported In


  • LabVIEW

Issue Details

Putting a Carriage Return, Line Feed, or End of Line character into my strings in LabVIEW seems to all do the same thing. What is the difference between these three characters?


All three of these characters are ASCII representations for the end of a line. With regards to strings, LabVIEW implements the same functionality for all three: It will end the current line of a string, and start a new one.

However at the operating system level, they are treated differently.

 The Carriage Return ("CR") character (0x0D, \r) moves the cursor to the beginning of the line without advancing to the next line. This character is used as the new line character in Commodore and Early Macintosh operating systems (Mac OS 9 and earlier).

 The Line Feed ("LF") character (0x0A, \n) moves the cursor down to the next line without returning to the beginning of the line. This character is used as the new line character in Unix based systems (Linux, macOS X, Android,etc).

 The End of Line ("EOL") character (0x0D0A, \r\n) is actually two ASCII characters and is a combination of the CR and LF characters. It moves the cursor both down to the next line and to the beginning of that line. This character is used as the new line character in most other non-Unix operating systems, including Microsoft Windows and Symbian OS.

Additional Information

To convert line endings programmatically, use LabVIEW's Normalize End Of It converts CR, LF, and EOL characters to the character you specify, uses the current operating system's default character in case you do not specify one.

Serial connections like RS-232 often use termination characters like Carriage Return (0x0D, \r), Line Feed (0x0A, \n), or Form Feed (0x0C, \f)as well. Use e.g. VISA Configure Serial Port to define the termination character your device expects. Sending the wrong termination character will often break your connection.