From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Aquire data at different rates from multiple devices and write to the same TDMS file with the same timestamp

I am trying to create a system that acquires data from multiple DAQ devices (at different rates) and writes the data to one file with the same time stamp.

The data I am acquiring are voltages (up to 500hz) and temperatures (up to 90 hz--> this is the max permittable)

 

I have based my VI off the Analog Input-Synchronization VI. The issue I am having is that when sampling at different rates and writing the data to the TDMS file the time stamps don't match up. Furthermore, if I run my program for 10 minutes, and say I want to read 100 samples per loop, only data for approximately the first 2 minutes is logged to the TDMS file whereas I want data for the full 10 minutes.

 

Any advice on how to achieve this is appreciated

 

I have attached my program saved using two different versions of Labview.

 

Thank you for your time.

 

Download All
0 Kudos
Message 1 of 6
(3,731 Views)

1. Why are they all at different sample rates?  I do not see anything in your code that would point to a good reason.

2. Assuming you can have everything at the same rate and depending on the DAQ cards, you could just set up all three cards in a single task.  If not the cards will not allow it, you could share your sample clocks between the three cards and then all samples will be taken together.

3. Assuming you actually do need different sample rates, I recommend just writing to three different groups in your TDMS file.  You can try to synchronize your samples in the report generation 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
Message 2 of 6
(3,718 Views)

Thank you for your reply Crossrulz.

 

The system will be used for abuse tests, and occassionally it is desirable to have voltages sampled much faster than temperatures, therefore I do need different sample rates.

 

For solution 3.: How do I go about writing to three different groups in the TDMS file? and how can I alter the report generation code to synchronize my samples.

 

Thanks again.

 

 

0 Kudos
Message 3 of 6
(3,714 Views)

@cdialessandro wrote:

For solution 3.: How do I go about writing to three different groups in the TDMS file?


There is a "group" input on the TDMS Write.  You just need a different name for each task you have.

 


cdialessandro wrote:and how can I alter the report generation code to synchronize my samples.

To be done properly, you need to find a common sample rate (think Least Common Multiplier) and "resample" all of your data to be at that common rate.  You can just reuse the data points for when you are adding samples or you could do some interpolation.  I have seen it done both ways.  Or if you are just showing graphs, just put the data in the same graph as waveforms and let the indicator do the job for you.  Of course, this advice is only valid since you are using a common start trigger so all data is starting at the same time.


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 4 of 6
(3,699 Views)

When the data is be gathered, how do I go about resampling it so that it is written to the TDMS file at a common rate / with the same time stamp?

0 Kudos
Message 5 of 6
(3,693 Views)

@cdialessandro wrote:

When the data is be gathered, how do I go about resampling it so that it is written to the TDMS file at a common rate / with the same time stamp?


Same method as I said before.  But this can be intensive, which is why I first recommended writing to the different groups during acquisition.


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 6
(3,690 Views)