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!