| Description |
DAQSTOPBUTTON(FIG,OBJ) adds a start/stop button to figure FIG. This button can be used to start and stop data acquisition object OBJ. DAQSTOPBBUTTON will also delete OBJ when FIG is closed (i.e., it sets FIG's CloseRequestFcn to delete the object).
DAQSTOPBUTTON(FIG,OBJ,'P1','V1','P2','V2', ...) specifies Property-Value pairs for configuring properties of the start/stop button. Any valid property of a togglebutton can be specified.
HBUTTON = DAQSTOPBUTTON(...) returns a handle to the start/stop button.
Example:
fh = figure; % Create a figure
ai = analoginput('winsound'); % Create an input object
addchannel(ai,1); % Add a channel
set(ai,'TriggerRepeat',inf); % Configure to run infinitely
set(ai,'TimerFcn','plot(peekdata(ai,500))'); % Each timer event will plot recent data
hButton = daqstopbutton(fh,ai); % Add the stopbutton |