How to a log analog input data from during background continuous acquisition ?
3 次查看(过去 30 天)
显示 更早的评论
I am trying to save data recorded during a background acquisition. In theory, following the online help, one could add a listener to the session and direct its src/evt to a file. However, perhaps because the session start is in a loop, I can´t get it to work with two listeners (I am not even sure if 2 are actually allowed), as the same source ('DataAvailable') is already called by another function (Scope). Any idea on how I could fix it ?
%% Recording cycle for i=1:cycles s = daq.createSession('ni'); a1 = addAnalogInputChannel(s,'Dev2','ai0','Voltage'); a2 = addAnalogInputChannel(s,'Dev2','ai1','Voltage'); lh = addlistener(s,'DataAvailable',@scope); s.IsContinuous = true; s.startBackground; pause(duration); s.stop s = daq.createSession('ni'); a1 = addAnalogInputChannel(s,'Dev2','ai0','Voltage'); a2 = addAnalogInputChannel(s,'Dev2','ai1','Voltage'); o1 = addAnalogOutputChannel(s,'Dev2','ao0','Voltage'); queueOutputData(s,EOD); lh = addlistener(s,'DataAvailable',@scope); s.IsContinuous = true; s.startBackground; pause(playback_duration); s.stop; release(s); end
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Logging 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!