From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Incorrect amout of samples in TDMS-File

Solved!
Go to solution

Hi, 

 

I have an odd issue.

When I'm setting the sampling rate to 4kHz (dt = 0.25ms) and 1000 samples I expect to get 40000 samples in the tdms-file within 10 seconds. 

But I'm getting less values.

When I set the sampling rate to 5kHz (dt = 0.2ms) and 1000 samples I'm getting the expexted 50000 samples in the tdms-file. 

 

So I guess this comes from the 5th digit of dt. When it's not 0 daqmx messes up. 

Does anyone also had this experience or has a workaround?

 

Thanks for any help.

0 Kudos
Message 1 of 3
(1,654 Views)
Solution
Accepted by topic author Yves

It could depend on how you generate the data.

 

If you sample blocks, and time with software, you might get a block or not depending on how exectly you're timing.

 

You might get a modulus of the nr. of blocks, ignoring the remainder. If the rate amounds to an exact number of qoutients, the remainder is 0. If not, you get less samples than expected.

 

I suppose you thought about this, but without knowledge about how the TDMS is generated, we can't be sure.

Message 2 of 3
(1,636 Views)
Solution
Accepted by topic author Yves

Hi Yves,

 


@Yves wrote:

When I'm setting the sampling rate to 4kHz (dt = 0.25ms) and 1000 samples I expect to get 40000 samples in the tdms-file within 10 seconds. 

But I'm getting less values.

When I set the sampling rate to 5kHz (dt = 0.2ms) and 1000 samples I'm getting the expexted 50000 samples in the tdms-file. 


Which DAQ hardware do you use?

Did you check the samplerate the DAQmx task is really using?

 

Not all DAQ hardware supports ALL sample rates, some devices are limited to just 16 or 32 different sample rates based on a certain main clock: 5kHz can be derived from 50kHz main clock with a divider of 10, while 4kHz cannot derived using an integer divider!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 3
(1,622 Views)