LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I have some suggesstions about saving data?

Recently, I recieved a reply to a question about saving data in which the person told me I should open the file, write one record, and close the file on each iteration because each interation is only a second. I've tried to figure it out but I can't, can someone explain to me how to do this?

Thanks in advance.
0 Kudos
Message 1 of 2
(2,444 Views)
In your original VI, (posted here) you used Write To Spreadsheet File.vi to write your data. You still can, with the following changes.
1. Move Write To Spreadsheet File.vi into the loop.
2. Create a path control or constant and wire it to the file path input of Write To Spreadsheet File.vi.
3. Wire a True boolean constant to the append to file input of Write To Spreadsheet File.vi.
4. Wire the output of the Transpose 2D Array function to the 2D data input of Write To Spreadsheet File.vi.
I just noticed that it looks like you have your array inputs swapped on the Insert Into Array function: The bottom array is
the one you'll insert into the top array. The shift register holds the total array so it should be wired to the top array input of Insert Into Array. The output of Transpose 2D Array is the new portion you want to insert into the total array so it should be wired to the bottom array input of Insert Into Array.
I originally suggested writing one record at a time because you were originally writing data only after to user pressed Stop. If anything went wrong before the user pressed Stop, you would lose all your data.
Message 2 of 2
(2,444 Views)