05-23-2014 07:11 AM - edited 05-23-2014 07:26 AM
I'm sure for you seasoned pros this will be a no-brainer but it's giving me a fair bit of grief.
The Situation
I'd like to collect data (voltage, voltage, current, pressure, pressure), plot it all continuously on a graph, then allow the user to review the data on the graph, then save it to a desired file path or discard it. That order is important.
The Problem
I created a VI (attached) that can function with the wrong order of operations (Run -> prompt for path -> begin logging to TDMS -> graph data live -> end after certain time passes) but can't seem to create a VI that will use the order of operations requested by my users. I've tried pulling the data out of the while loop and writing it to a file or spreadsheet, but I either get errors due to missing data, don't know how to properly convert the data line to plot it, or get an empty data file.
Any help is appreciated!
05-23-2014 07:30 AM
How much data are you collecting? If collecting a lot of data, then it doesn't make any sense to change from what you are doing. If it is just a short run, then you could save your data in arrays and then write to the TDMS file manually.
05-23-2014 08:01 AM - edited 05-23-2014 08:01 AM
@crossrulz wrote:
How much data are you collecting?
Roughly 10 seconds worth at 1,000hz from 5 channels. Call it 50,000 data points.
@crossrulz wrote:
If it is just a short run, then you could save your data in arrays and then write to the TDMS file manually.
Not sure if this counts as a short run. If it does could you baby-step me through the data->array conversion?
05-23-2014 08:43 AM
I would read that data as waveforms. You can then use Append Waveforms.vi (Waveform->Analog Waveform palette) to keep adding your new data to the old. Keep the wavforms in a shift register.
05-23-2014 08:54 AM - edited 05-23-2014 09:20 AM
Assuming I'm looking at this correctly, I don't have a problem of data missing from my waveform (I can run the program and see all 10 seconds of collected data in my plot). The problem lies in taking it from the waveform and putting it into a TDMS, spreadsheet or text file after it's collected.
Edit: It's possible I'm missing an underlying concept of data buffering here. I'm working under the assumption that because the 10 seconds of data is all visible to me on my plot that it has been stored somewhere and I simply need to retrieve it. Maybe that's wrong?
05-23-2014 12:06 PM - edited 05-23-2014 12:06 PM
Sounds like you are using a chart. Use a graph instead.