LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

line feed constant adds carriage return

Solved!
Go to solution

I'm writing a one line ASCII file in Labview (32 bit 2011, SP1, Windows 7 machine) that will be read by a embedded Linux SBC.

 

I concatenate my desired string with a Line Feed Constant. However, it doesn't seem to put out 0x0A, I always get CR/LF (0x0D/0x0A).

I've also tried a string constant in hex mode "0A". And with a string constant in '\ Codes Display', when I put "\A", it changes immediately to "\n".

With any of these options, the last two characters of the file I build are always 0D 0A, not just 0A like I need for Linux.

 

Anyone have any insight, suggestions? Thanks.

0 Kudos
Message 1 of 3
(3,587 Views)
Solution
Accepted by topic author bigmaple

Are you using the Write Text File function? If so, this is by design, and also documented in the LabVIEW Help for that function, where it says:

 

This function appends platform-dependent, end-of-line (EOL) characters to the elements of an array even if you right-click the function and remove the checkmark next to the Convert EOL shortcut menu item.

 

The underlined portion is my emphasis only to point out what may be a confusing statement. In the past, the Help file said:

 

This function converts all end-of-line characters to platform-dependent end-of-line characters unless you right-click the function and remove the checkmark next to the Convert EOL shortcut menu item.

 

It was pointed out that this was not true with arrays, as it ignored the checkmark if you fed in an array. Thus, the Help file was changed to point this out. I still think the Help file needs a sentence before this to explain the general operation of the Convert EOL option, with the above sentence serving as an exception clause.

0 Kudos
Message 2 of 3
(3,582 Views)

Thank you! I found that unchecking "Convert EOL" did what I wanted, ie Line Feed is now simply 0A.

0 Kudos
Message 3 of 3
(3,572 Views)