08-29-2013 08:06 PM
Hi,
I wrote an vi for reducing noise from my signal source (voltage). When I wrote to spreadsheet file, it only saved 10 rows of data. How can I continue to record the signal until it I stop the vi.
Thanks in advance,
Michael
Solved! Go to Solution.
08-29-2013 08:20 PM
There is a boolean input to the Write to Spreadsheet File VI to append to the file. Make sure this is set to TRUE.
A better way would to create the file before your loop starts, write to it inside of the loop, and close it after the loop. Use the Array to Spreadsheet String to format the data and Write Text File to write the data to the file. I tell you to do it this way because the Write to Spreadsheet file will just keep opening and closing the file each time it writes. This is an expensive operation and can slow down your application.
08-29-2013 08:25 PM
Hi MichaelCKW,
Refer to the help file on what each terminals of the Write to Spreadsheet File.vi is for. From looking at your code, what you are trying to do is that you are trying to store 10 rows of data for every loop iteration? If so, perhaps you can try to create a true constant and connect it to "append to file?" terminal.
If you put it as false (in default it is false), what you are trying to do is that you are replacing the same rows every loop iteration. By making "append to file?" value as true, you are to append data to the existing file.
Write to Spreadsheet File.vi
http://zone.ni.com/reference/en-XX/help/371361J-01/glang/write_to_spreadsheet_file/
Hope it helps.
Warmest regards,
Lennard.C
08-30-2013 04:16 PM
Hi,
First of all, thanks for your help and prompt reply.
I found out that my problem is not really related to "write to spreadsheet File.vi". I used "highlight execution" to find out that my "shift register for loop" stopped after generating 10 data points. I don't understand why it stoped at the shift register stopped at #10. Would you suggest a way to solve this problem?
Thanks,
Michael
08-30-2013 04:40 PM
08-30-2013 05:11 PM
Thanks Dennis. You solved my problem.
I will take Crossrulz and Lennard's comments seriously. I just want to solve one problem at a time. Before writing the data to a spreadsheet, I would like to make sure I have a good set of data points first.
Thanks again for your help!
Michael