# DAQ Device is Not Sampling at Specified Rate in LabVIEW

Updated Nov 27, 2019

• LabVIEW
• LabVIEW NXG

• NI-DAQmx

## Issue Details

I have a DAQ device using DAQmx. I specify a sample rate, but when I run my VI, the device samples at a slightly different rate. I have noticed that some frequencies work better than others. Why is this? What frequency should I expect from my device?

## Solution

The following describes the general approaches on how to calculate the expected sample rate:

1. X = Sample Clock Timebase / Specified Sample Rate
2. Round X down to the next integer value.
3. Actual Sample Clock = Sample Clock Timebase / X

For example,

1. 20 MHz / 17545 Hz = 1139.93
2. 1139.93 rounded down is 1139.
3. 20MHz / 1139 = 17559.26 Hz

For Analog Output tasks and Digital I/O:

1. X = Sample Clock Timebase / Specified Sample Rate
2. Round X to the nearest integer value (up or down).
3. Actual Sample Clock = Sample Clock Timebase / X

So, for the example given:

1. 20 MHz / 17545 Hz = 1139.93
2. 1139.93 is rounded up to 1140.
3. 20 MHz / 1140 = 17543.86 Hz

Thus, 17543.86 is the actual sample rate for the analog output or digital task