How to get recent n-samples using Data acquisition toolbox?
조회 수: 9 (최근 30일)
이전 댓글 표시
Hi, I'm new to Session-Based Interface with Data Acquisition Toolbox. I'd like to make a real-time feedback system (I used NI DAQ device(USB-6002).). Using Legacy interface, we can use the command below to get recent n-samples.
data = peekdata(obj,samples)
In Session-Based Interface, I wrote a code below, but got an error like this
"On this platform, notifications more frequent than 20 times per second may not be achievable".
I'd like to get recent samples more frequently.
function func1
daqInfo = daq.getDevices;
daqVendor = daq.getVendors;
s=daq.createSession(daqVendor.ID);
addAnalogInputChannel(s,daqInfo.ID,'ai0','Voltage');
s.Rate = 16000;
s.IsContinuous = true;
lh = s.addlistener('DataAvailable',@func2);
s.NotifyWhenDataAvailableExceeds = 160;
end
function func2(src,event)
dat = data.event;
end
Is there any way to get recent n-samples more than 100 times/second(e.g. >100Hz)?
Thanks in advance.
댓글 수: 0
답변 (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!