Showing results for 
Search instead for 
Did you mean: 

How to find the actual sample rate of DAQmx Read on Analog Input?

Go to solution


I see from the data sheet that the actual sample rate used in hardware can be quite different to the desired sample rate.   Eg my current 9239 can sample at 50kHz, 25kHz, 12.5kHz etc.  So if I request 44100 kHz sample rate, I actually get 50kHz.


How can I find the actual sample rate used?  My DAQmx read outputs an array of doubles.  Using waveorm read output you can look at the number of samples and the length of the waveform to determine sample rate.  But I do not want a waveform, I want an array of doubles!


I would like to use the same code across different cards and the user can set the desired sample rate.  Actual sample rate is needed for processing.


Does anyone know how to determine actual sample rate used by DAQmx read?






0 Kudos
Message 1 of 6



Thanks for your help.  I had seen both of those articles but got stuck.  I can not read the properties from the DAQmx Timing property node as shown in the picture in the first link.  See attached picture...


If I download the example VI at the first link, it shows the correct property being read.  If I click on that and select property, I only get the same options shown in the picture below. If I change the DAQmx task create from AO voltage to AI voltage, I get an error that the SampClk.Rate property is not supported.  Perhaps it is only an analog out thing?








0 Kudos
Message 3 of 6
Accepted by topic author ashesman1



I was able to implement the timing property node in my VI by copying and pasting it from the example VI HERE.  I now get the correct actual sample rate.



Message 4 of 6

For those of you who (like me) were unable to find an example file to drag this from, you can get this property node as follows:


Search for "Timing Property Node" and place on block diagram

Right click -> "Select Filter..."

Select "Show All Attributes"

Hit OK


Now you can see all attributes under the class.

Click the preselected property value, and navigate to the Sample Clock submenu, and the options should be there.

Message 5 of 6

Good tip when needed.  Not sure how common it is for that option to be off.  I just dropped a DAQmx Timing property node into a new vi and found that "Show All Attributes" was already selected by default.   This was true for both LV 2018 (32-bit) and LV 2020 (64-bit).


Perhaps it's a persistent setting, remembering some time in the distant past when I selected "All Attributes"?  I remember kudo'ing a request for such persistance many years ago...


<search>  Nope, not exactly.   Turns out it was something similar but not quite the same.



-Kevin P


CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 6