ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing strings to file

This is probably very simple but i cannot figure it out.I 'm used to line by line programming and still very new to labview
thats my excuse anyway....
 
I have a concatenated string that i want to append to a file.There will be several strings going to the file over time and
i want them all seperate lines.At the end of the program the file will be closed.
 
I am using version 8.0 and there are the following options in the File I/O menu.
Write to spreadsheet which does not work directly with strings......Write to text file which does not seem to allow appending to files.
 
Can anyone advise who this can be done ?      Either a text file or spreadsheet file would be fine.
 
Labtech5555
0 Kudos
Message 1 of 6
(2,888 Views)

Hi labtech5555,

you can use the function "Write to Text File". Hope this helps.

Mike

0 Kudos
Message 2 of 6
(2,884 Views)

Hi Mike,

Tried modifying your VI into my program the best i could.Possibly made a mistake which is my fault

but the data going to the file is over written everytime a new string is sent to the file.At the end of my string

i have the end of line character which i assume is correct.

Attached is a picture.

Thanks,

            Labtech5555

0 Kudos
Message 3 of 6
(2,865 Views)

Hi labtech5555,

try this version. Hope it helps.

Mike



Message Edited by MikeS81 on 02-29-2008 02:18 PM
0 Kudos
Message 4 of 6
(2,852 Views)
This is the expected default behaviour when using a file refnum. See attached example that shows how to add data to the end of a file. The context help of Write to Text File will share some light.

I removed the while loop because it is not needed in your case.
0 Kudos
Message 5 of 6
(2,846 Views)

Thanks Guys,

Got it working now.....Your help is much appreciated.Smiley Very Happy

Labtech5555

0 Kudos
Message 6 of 6
(2,823 Views)