(Not recommended) Stop background operation
session object function is not recommended. Use
object functions instead. See Compatibility Considerations.
stop( stops the session and all
associated hardware operations in progress. Stopping the session flushes all
undelivered data that is below the threshold defined by the property NotifyWhenDataAvailableExceeds, and
will not fire any more
Stop Background Signal Generation
Create a continuous signal in background mode, and generate output until you explicitly stop it.
Generate output data.
s = daq.createSession('ni'); addAnalogOutputChannel(s,'cDAQ1Mod2',0,'Voltage'); s.IsContinuous = true; s.Rate = 10000; data = linspace(-1,1,5000)'; lh = addlistener(s,'DataRequired', ... @(src,event) src.queueOutputData(data)); queueOutputData(s,data) startBackground(s);
Perform other MATLAB operations during signal generation, then stop the session when you no longer need the signal.
s — Data acquisition session
Data acquisition session, specified as a session object. Create the
session object using
daq.createSession. Use the data
acquisition session for acquisition and generation operations. Create one
session per vendor and use that vendor session to perform all data
Version HistoryIntroduced in R2010b
session object interface is not recommended
Use of this function with a
session object is not recommended. To
access a data acquisition device, use a
with its functions and properties instead.
For more information about using the recommended functionality, see Transition Your Code from Session to DataAcquisition Interface.