"If" statements for NI daq functions!? Help?
Mostrar comentarios más antiguos
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!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Acquisition Toolbox Supported Hardware en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!