LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create .csv spreadsheet from data

Solved!
Go to solution

I'm brand new at LabVIEW, trying to teach myself as I work on modifying some "legacy code" I received for my project.  I've learned most of it from trial and error and reading the forums, but I haven't been able to figure out this problem.

 

I'm trying to graph and record data I receive from a few instruments. I've been able to capture and graph the data just fine, but when I try to create a spreadsheet, all the program will save is the last data point.  I'd like to be able to record the data points for the entire time the program is collecting data. My program is decently complex, so what I've attached here is just the bare minimum of the code dealing with the graphs and spreadsheet. I've added simulated signals instead of my data, just so you can see how the data is handled. I've also left in the while loops and such, because even though they are unnecessary here, I think part of my problem is how I move between loops.

 

Any help would be appreciated!

 

 

0 Kudos
Message 1 of 4
(2,920 Views)
Solution
Accepted by topic author hrice

You have to use a shift register to collect data into a buffer. Then, when you stop the data acquisition you can write out this buffer. See attached mod.

 

Note: This method can cause problems if the array(s) just grow and grow, as LabVIEW will need to do memory shuffling. Also, this requires that you have a contiguous memory block for the array(s). A better method is to limit the size of this array and write it out periodically.

 

Also, I'm assuming that you configured the Convert from Dynamic Data functions based on the actual data you have, since for the example you provided you can simply configure the Convert from Dynamic Data to return a 1D array, negating the need for the Index Array function.

0 Kudos
Message 2 of 4
(2,911 Views)
Thanks! That did the trick.
0 Kudos
Message 3 of 4
(2,903 Views)

Instead of a shift register, I would probably use two feedback nodes. Less wires. 😉

 

Alternatively, you can also autoindex at the loop boundary and reshape to a 1D array later, see image.

 

Message Edited by altenbach on 07-14-2009 03:15 PM
0 Kudos
Message 4 of 4
(2,889 Views)