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 Center および File ExchangeData Acquisition Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by