LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to synchronising DAQmx sampling rate with TDMS in while loop?

Solved!
Go to solution

I have been trying to log the data from DAQmx functions to the conventional TDMS stream method in a while loop. The problem is that I can never synchronise the sampling rate of the data from DAQmx and the Elapsed Time Function. In fact, changing the rate on Sample Clock Function does not affect the sampling rate into the TDMS.So the data logged into the TDMS file is always at constant rate.

 

This is causing me a massive problem when come to processing the data.

 

I have attached the labview code and one of the data.

 

Can anyone tell me what I have done wrong here?

 

Download All
0 Kudos
Message 1 of 5
(2,696 Views)

You should read out the data from DAQmx as waveform. This data type contains timing information and can be added to the TDMS.

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(2,690 Views)

Thanks for the reply, Norbert.

Reading as 1D waveform can only log the data from 1 channel. Potentially, I would like to log data from multi strain gauges and accelerometer at the same time.

Also, I still can't change the sampling rate...  I think it is always at 0.000620, which is not good for later data analysis.

Is there any other way to solve this problem?

0 Kudos
Message 3 of 5
(2,682 Views)

Hi Norbert,

 

I have just got the timing right by seperating into two while loops, but here is another problem. The data from DAQmx will only read up to around 0.3 seconds.

Do you happen to know the reason for this?

 

Thanks for your time and help,

 

Tong

 

Download All
0 Kudos
Message 4 of 5
(2,673 Views)
Solution
Accepted by topic author tonger

@tonger wrote:

Thanks for the reply, Norbert.

Reading as 1D waveform can only log the data from 1 channel. Potentially, I would like to log data from multi strain gauges and accelerometer at the same time.

Also, I still can't change the sampling rate...  I think it is always at 0.000620, which is not good for later data analysis.

Is there any other way to solve this problem?


That statement about logging only a single channel is absurd. And your two loop solution is just as wrong. A 1D waveform contains as many channels as you specify and it has an actual timestamp in it - not some asychronous number from a different loop.

0 Kudos
Message 5 of 5
(2,660 Views)