11-01-2013 09:28 AM
I am acquiring data, making waveforms, and writing to TDMS.
I physically took data for 2 hours and did timed events.
When I "Get Waveform Components" and determine array size of components I get the following result for data length:
dt = 0.002 sec/sample (500 hz)
Array Size of waveform components = 129350 samples
0.002 x 129350 = 258.7 sec = 4.3 min of total data length
When I view the waveform in Labview, I see an accurate representation of my timed events.
It looks like the full 2 hours of data is captured to some degree.
If I am losing data, does that mean my dt isn't always equal to 0.002 like "Get Waveform Components" says?
Any other ideas?
Thanks!
11-01-2013 09:38 AM
If you read back the file in LV, will it draw correctly, or just the last (or first) part?
If the no. of samples is correct, you're sampling at ~20ms or 0.02 instead of 0.002, else you have a bug in the file writing, as not appending but replacing or similar.
/Y
11-01-2013 09:48 AM
It looks like it is drawing correctly.
Plot is attached.
11-01-2013 09:55 AM
Waveforms assume a constant dt with each sample occuring every dt. If you are missing data, then the waveform will show a shorter acquisition time and what you actually took. Since you claim your times look right, then it is safe to assume you had no data loss.
DAQmx will give you warnings if you miss data from the DAQ card's buffer (data overwritten). So if you didn't get a warning about that, then you didn't miss any data.
11-01-2013 10:03 AM
The waveform acquisition time as calculated does show a shorter time than what I actually took.
The plot attached above shows 4 events ocurring over 2 hours (last event occurred right at 2 hours), but the time data shows a total acquisition of ~4 mins.
11-01-2013 10:20 AM
Ok, then it is time to look at some code. How are you saving this waveform? Can you share the code?
11-01-2013 10:49 AM
I am writing it to TDMS.
I could share parts of the code.
What would be helpful for you to see?
11-01-2013 02:50 PM
The plot ends at 260(s?), thus ~4,5 mins so the Get waveform information seems correct. I'd guess there's a bug in the write to TDMS part.
/Y
11-04-2013 07:45 AM
Thanks for reply. I checked for a bug in the write to tdms part and nothing stood out.
Is there anything unique about the way a tdms file writes that might cause something like this?
11-04-2013 10:26 AM
@adam_f wrote:
Thanks for reply. I checked for a bug in the write to tdms part and nothing stood out.
Is there anything unique about the way a tdms file writes that might cause something like this?
Not really. You will need to show your code if you expect us to help you anymore.