getdata() function: is it a realtime getting data from DAC ?
Show older comments
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
Answers (0)
Categories
Find more on National Instruments Frame Grabbers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!