07-14-2009 03:40 PM
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!
Solved! Go to Solution.
07-14-2009 04:09 PM
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.
07-14-2009 04:26 PM
07-14-2009 05:14 PM - edited 07-14-2009 05:15 PM
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.