getdata() function: is it a realtime getting data from DAC ?
显示 更早的评论
Hi, I'm new in real time processing field. I want to analyze the data to detect some range of frequency every half second. Here is my code. the data show me every 1 sec with around 0.03-0.06 time-delay. I think my code received the data 200 sample per loop(sec).
My question is can I get the data in every half sec or every 1/200 sec (which mean 1 input, 1 data come).
THANK YOU
if true
delete(daqfind)
ai=analoginput('nidaq','Dev1');
addchannel(ai,0); %DAQ Channel [x]
set(ai,'InputType','Differential');
ActualRate = setverify(ai,'SampleRate',200);
set(ai, 'TriggerType','Manual');
set(ai,'SamplesPerTrigger',200);
set(ai,'TriggerRepeat',inf);
start(ai);
i=1;
while(true)
trigger(ai)
% a=tic;
[data,time] = getdata(ai);
% time1(i,1)=toc(a)
t = timer('TimerFcn',@(x,y)disp('Hello World!'),'StartDelay',0);
if length(data)==200
clearvars data time
end
i=i+1;
end
end
回答(0 个)
类别
在 帮助中心 和 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!