Unable to set precise sample rates when acquiring data using NI cDAQ-9171 USB chassis

조회 수: 1 (최근 30일)
I'm writing a program for acquiring analogue data using a NI cDAQ-9171 USB chassis. I'd like to have the flexibility to acquire data at a range of sample rates, however I'm unable to set the sample rates precisely at certain sample frequencies.
Here is the code I'm using to configure the data acquisition object:
d = daqlist;
d = d(1,:);
s = daq('ni');
ch = addinput(s, d{1,2}, 0:31, 'Voltage');
s.Rate = sampleRate;
For some sample rates (100, 200, 400, 800, 1000Hz), I am able to set the sample rate precisely. E.g. if I set sampleRate=500; and then I view the s object in the command window, I can see that the s.Rate property is exactly equal to sampleRate (i.e. 500)
However, for other sample rates (300, 600, 900, 1100, 1200Hz etc.), the s.Rate property can't be set precisely to these frequencies. E.g. if I set sampleRate=600; and I view the s object, I see that s.Rate=600.0015Hz
If anyone could explain what's happening here to me, or knows a way around this problem, it would be much appreciated!
(The code uses the Data Acquisition toolbox and is based on this example Capture Data with Software-Analog Triggering - MATLAB & Simulink - MathWorks United Kingdom)
  댓글 수: 4

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Simultaneous and Synchronized Operations에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by