LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in writing data to a text file

I Need help in writing data to a text file. I want to combine the output of the 1st graph( X & Y coordinates) to a text file. I tried few things, the VI runs but the text file is not readable.
can you please suggest something.
 
Thanks.
0 Kudos
Message 1 of 3
(2,589 Views)

Before you write to a text file, you must convert arrray data to spreadsheet string format.

You could use 'array to spreadsheet string' function in Strings functions palette, and then write the resultant string to file using 'write to file' function

Or you can use 'write to spreadsheet file .vi' function in File functions palette

Sorry could not open and see your vi, hence this generic solution

Regards

Dev

Message Edited by devchander on 10-26-2006 05:16 AM

Message 2 of 3
(2,586 Views)
Your basic problem is that you're simply concatenating all the numbers together, but you have nothing to separate them. What you need to do is:

  1. Eliminate the for-loop where you're converting the numbers to string. (Side note: you don't need a loop to convert an array of numbers to an array of strings. The string conversion functions are polymorphic.)
  2. Wire the X and Y arrays into a build array. This gets you a 2D array of numbers.
  3. Wire the 2D array into the "Write to Spreadsheet File" function.
That's it.
Message 3 of 3
(2,561 Views)