Data Acquisition in GUI
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I wrote the below code into a seperate .m file and it works properly.
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);
But when I copy these code to a push button callback function in my GUI. It stops generate the signal.
Can anyone help me, soooo appriciated!
0 comentarios
Respuestas (1)
Geoff Hayes
el 13 de Ag. de 2019
Bohan - see your other question https://www.mathworks.com/matlabcentral/answers/475625-daq-cannot-generate-signal-in-gui-callback-function for an explanation of this behaviour.
0 comentarios
Ver también
Categorías
Más información sobre Simultaneous and Synchronized Operations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!