LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How is dt from "Get Waveform Components" calculated?

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!

 

  

0 Kudos
Message 1 of 11
(4,486 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 11
(4,481 Views)

It looks like it is drawing correctly.

 

Plot is attached.

0 Kudos
Message 3 of 11
(4,472 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 11
(4,461 Views)

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.

 

 

0 Kudos
Message 5 of 11
(4,459 Views)

Ok, then it is time to look at some code.  How are you saving this waveform?  Can you share the code?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 11
(4,455 Views)

I am writing it to TDMS.

 

I could share parts of the code.

What would be helpful for you to see?

0 Kudos
Message 7 of 11
(4,450 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 8 of 11
(4,427 Views)

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?

 

0 Kudos
Message 9 of 11
(4,382 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 11
(4,368 Views)