05-12-2010 02:35 PM
Dell Netbook, WindowsXP home, NI-6008, Labview 8.5.1
I'm reading in 8 analog signals at 100Hz in a psydo-real-time app. I cannot write directly to a data file during data collection (processor/flash drive to slow), but can store the data into 4 seperate 2D arrays, with a timestamp added. Once I am done collection data I would like to save each array in to a seperate text (csv) file. Using a for-loop takes to long and using the "array to spreadsheet string" adds labels that I can't seem to change. I'm trying to get a stripped down text file of 3 columns and rows that equal the number of samples I collected (e.g., a 1 minute session would have 3 columns and 6000 rows).
1,1.3,1.5,
2,1.2,1.4,
3,1.4,1.1,
4,1.5,1.2,
5,1.4,1.4,
etc
Thanks,
Troy
Solved! Go to Solution.
05-12-2010 03:07 PM
05-12-2010 03:09 PM - edited 05-12-2010 03:09 PM
Not exactly sure what labels you are talking about but for me the Write to Spreadsheet File Vi behaves exactly like what you say you want.
If i wire a 2-d array to it it writes the contents of the array to a file without adding anything aside from the dilimiters.
05-12-2010 03:15 PM
Yes, "Write to Spreadsheet file" does give me exactly the format I want, but I have only been able to use that vi in a for loop. The "Array to Spreadsheet" vi lets me write the entire array without the for loop. Is there a way to use the "Write to Spreadsheet File" vi to dump the entire array into the file?
Thanks,
Troy
05-12-2010 03:16 PM
I will try, I don't have a lot of experience clipping out bits of code.
Thanks,
Troy
05-12-2010 03:19 PM
If you wire a 2D array into the Write to Spreadsheet File, you will get all data written to the file without using a For Loop. If you are not able to do this, post your code. You should be creating a 2D array from your data (no commas). Wire this into the 2D array input of the Write to Spreadsheet File.
05-12-2010 03:20 PM
tzarcone wrote:Is there a way to use the "Write to Spreadsheet File" vi to dump the entire array into the file?
Just wire the array to the "2d Data" input and it should write the whole array at once.
05-12-2010 03:29 PM
05-12-2010 03:34 PM
Well I think I over did the code picture. It didn't look that big when I loaded it. Anyway, you will see from my code the 1. I'm a novice and 2. that I'm trying to seperate data collection from saving the data using a frame squence. The limitation is the CPU and flash drive, when I try to collect and save, my timing gets all screwed up.
I did try to run the 2D array straight into a file, but I probably coded it wrong.
Thanks,
Troy
05-12-2010 03:53 PM
OK, here is another picture with one file (filename csv 1) being saved as "Array to spreadsheet" and another file (filename csv 2) using the "write to spreadsheet" vi. The second file only gives me the last sample (e.g., 6000,1.234,1.450).
Cheers,
Troy