How to a log analog input data from during background continuous acquisition ?

조회 수: 3 (최근 30일)
LO
LO 2018년 7월 19일
편집: LO 2018년 7월 19일
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개)

카테고리

Help CenterFile Exchange에서 Data Logging에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by