LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Solved!
Go to solution

Hi,

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?

 

Thanks

 

Ashley

 

0 Kudos
Message 1 of 6
(6,638 Views)

Hi,

 

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?

 

Thanks

 

Ashley

 

 

.  

0 Kudos
Message 3 of 6
(6,567 Views)
Solution
Accepted by topic author ashesman1

SOLVED...

 

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.

 

Capture.PNG

Message 4 of 6
(6,557 Views)

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

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

 

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 6
(3,132 Views)