"If" statements for NI daq functions!? Help?
Ältere Kommentare anzeigen
Hi all,
I am trying to get matlab to output some signals via my NI card, but I would like to turn on and off the signal via a timer using "if" statements.
For example,
experimentStartTime = tic;
niSession = daq.createSession('ni');
niSession.addAnalogOutputChannel('dev1','ao0','voltage');
niSession.queueOutputData([stimulus']);
stimStartTime = toc;
if toc-stimStartTime < 5
niSession.startBackground();
elseif toc-stimStartTime > 5
niSession.stop()
end
However, MATLAB doesnt seem to run through the if loops and stop the analog Output. Any help would be great. Thanks!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Data Acquisition Toolbox Supported Hardware finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!