|
Thanks for the tip, unfortunately I already have drawnow statements after the plot statements. Do I need them elsewhere? Is there a way to post the code up here?
Here is the a piece of the structure. The run button callback calls a datacapture function; Listed below. Both plot statements have drawnows listed after them.
function handles=dataCapture(handles)
ai=handles.ai;
preview=handles.preview;
NFFT=handles.NFFT;f=handles.f;
i=1;
handles.stopButtonState=0;
while ai.SamplesAcquired < ai.SamplesPerTrigger
stopButtonState=get(handles.StopCapturePushButton,'Value');
if stopButtonState==1
stopButtonState
stop(ai);delete(ai);display('Stopping device');
return;
end
if (ai.SamplesAcquired==0)
stop(ai);delete(ai);display('Not acquiring data, stopping device');
return;
end
while ai.SamplesAcquired < preview*i;
stopButtonState=get(handles.StopCapturePushButton,'Value');
if stopButtonState==1
stopButtonState
stop(ai);delete(ai);display('Stopping device in while loop');
return;
end
% display('yes')
if (ai.SamplesAcquired==0)
stop(ai);delete(ai);clear ai;display('Not acquiring data, stopping device');
return;
end
end
data= peekdata(ai,preview);handles.data=data;
% assignin('base','data',data);
set(handles.figure1,'CurrentAxes',handles.RawDataAxes);hold off;cla(handles.RawDataAxes);
hold on;plot(handles.RawDataAxes,1:preview/2,data(1:preview/2,:));drawnow;legend(handles.RawDataAxes,'Q1','Q2','Q3','Q4');
% Performing and plotting FFT
handles=PerformAndPlotFFT(handles);
i=i+1;
end
display('done')
|