LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FILES I/O

I want to save strings that I read in serial port. I can write a string in a txt file, but my problem is that I want save more string one below other in a while structure. Anybody has any idea? What do I do for save strings in the same file? What vi could be me useful? Thanks a lot.
0 Kudos
Message 1 of 4
(2,734 Views)
Try building an array of string values and then writing after your process has concluded. You can write an array of strings by converting to a spreadsheet string. THis function is located under the strings subpalette. You can then use the write text to file function under the file i/o palette. This by default will write your elements of the array as tab delimited in your file. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 2 of 4
(2,734 Views)
Hi,

You can use the "file open", "file close", and "format into file" functions.
Just put the file open before the loop, the close after, and the format into
file inside the loop. The format into file works just like the format into
string.

Regards,

Wiebe.


"IMMA" wrote in message
news:50650000000800000015C20000-1077587809000@exchange.ni.com...
> I want to save strings that I read in serial port. I can write a
> string in a txt file, but my problem is that I want save more string
> one below other in a while structure. Anybody has any idea? What do I
> do for save strings in the same file? What vi could be me useful?
> Thanks a lot.
0 Kudos
Message 3 of 4
(2,734 Views)
Hello,

The previously posted solutions are definitely valid. If you'd like some example files to work with, you can (from the front panel of your application) click [Help]>>[Find Examples] and search for "I/O" and "strings."

Good luck!

Joe Des Rosier
National Instruments
Message 4 of 4
(2,734 Views)