04-15-2019 09:25 AM
Hello to all,
I am using a producer-consumer pattern in my VI. The producer computes several data (27 data) and passes them in a queue (the data are converted to string before).
The consumer has to write each data in a text file. When the producer sends 27 data, it means one cycle has been completed.
I would like to write one line per cycle, meaning each time the consumer writes 27 data, it has to go on a new line (send a new line instruction).
I tried to write "\n" to the file to go on a new line, but it doesn't work, it simply writes "\n" on the text file.
How can I make a new line on a txt file?
Thanks
Solved! Go to Solution.
04-15-2019 09:31 AM
Write a Carriage return constant to the text file
Ken
04-15-2019 09:32 AM
I can only guess what it is going wrong since you didn't attach the problem VI to look at. But I'm going to guess it is a newbie mistake.
You created a string with a \n in it, but it was still set for normal display mode. You forgot to set it to \codes display mode before typing the "\n".
04-15-2019 09:34 AM
@Ken_Naylor wrote:
Write a Carriage return constant to the text file
Ken
A carriage return constant is a "\r" code. He wants the constant to the right of it for new line or linefeed code "\n".
04-15-2019 09:39 AM - edited 04-15-2019 09:42 AM
Newline Constant
04-15-2019 10:16 AM
Thank you so much, I didn't see that option before 🙂