필터 지우기
필터 지우기

rate of acquisition with DAQ board not equal to s.Rate

조회 수: 2 (최근 30일)
John
John 2017년 6월 6일
답변: Sid Jhaveri 2017년 6월 9일
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?

답변 (1개)

Sid Jhaveri
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.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by