NI DAQ External Clock different to Sample Rate

조회 수: 3 (최근 30일)
Matt
Matt 2014년 8월 8일
Hi,
I have NI DAQ 6341 connected to a desktop. I would like to clock the DAQ with a 10MHz square wave (on input PFI0) and then sample from an analogue input (ai0) at a rate of 1k samples per sec. Hence the clock rate and sample rate are very different.
Sampling normally works:
d = daq.getDevices
s = daq.createSession('ni');
s.addAnalogInputChannel('Dev2','ai0','Voltage');
s.Rate = 1000;
s.DurationInSeconds = 1;
data = s.startForeground();
But Adding a clock then seems to cause problems:
d = daq.getDevices
s = daq.createSession('ni');
s.addAnalogInputChannel('Dev2','ai0','Voltage');
addClockConnection(s,'External','Dev2/PFI0','ScanClock')
s.Rate = 1000;
s.DurationInSeconds = 1;
data = s.startForeground();
The errors that I get are either:
With rate of 1000
"Timeout expired before operation could complete."
Or with rate of 10e6 (equal to the external reference clock)
"Rate cannot exceed 500000 in the current configuration."
I understand this error as the NI DAQ can't sample that high.
So the basic problem is that I can't sample with an external reference clock using a sample rate below the external clock rate.
Many thanks for any advice on this issue.
Matt

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Acquisition Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by