rate of acquisition with DAQ board not equal to s.Rate
4 ビュー (過去 30 日間)
古いコメントを表示
I'm using the Data Acquisition Toolbox to create TTLs using outputSingleScan with a NI DAQ USB 6002. I want the single scan to be .05 seconds long (A rate of 20 scans per second).
d = daq.getDevices;
d(1);
s = daq.createSession('ni');
ch = addAnalogOutputChannel(s,'Dev2', 'ao0', 'Voltage');
s.Rate=1/.05;
outputSingleScan(s, 5);
When I run this code the output on my computer does not appear to have scans of .05 (50 milliseconds). They are more between 1 and 3 milliseconds.
I have also tried using s.DurationInSeconds and s.ScansQueued with S.Rate, but both give errors. How can I make the length of one outputSingleScan .05 seconds?
0 件のコメント
回答 (1 件)
Sid Jhaveri
2017 年 6 月 9 日
"s.Rate" (where s is the session object) is usually used while doing continuous acquisition. Thus, I would suggest you the following:
1) Try sending data continuous using "startForeground" or "startBackground" function and check is that is giving you the sampling rate of 20 scans/second.
2) If you want to use "outputSingleScan" itself, then try giving an explicit pause after using it.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で National Instruments Frame Grabbers についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!