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!