Memory Issue with DAQ

조회 수: 6 (최근 30일)
Josh
Josh 2012년 6월 29일
답변: Tao Cui 2017년 4월 25일
We are having a memory problem with the Data Acquisition toolbox in Matlab. We are using a National Instruments card, NI PCIe-6363, with NI-DAQmx drivers 9.5.0. The problem is memory build up. Using the Windows Task Manger, it can be seen that Matlab idles around 300 MB but during acquisition, that number increases and can get as high as 2-3 GB. The severity of this problem increases as more channels are utilized. Below is a sample of the code that can be used to induce this memory overflow. I think this was also a similar problem here: http://www.mathworks.fr/matlabcentral/answers/37350-possible-memory-leak-in-data-acquisiton-toolbox-using-ni-daq-6229-bnc-in-continuous-output-mode
Also, the spec of the computer I'm using are: Windows 7, 64 bit, 4 gigs of ram. Matlab R2012a.
s = daq.createSession('ni');
s.addAnalogOutputChannel('Dev1',0,'Voltage');
s.addAnalogOutputChannel('Dev1',1,'Voltage');
s.addAnalogOutputChannel('Dev1',2,'Voltage');
s.IsContinuous = true;
s.Rate = 400000;
data = repmat(linspace(-1, 1, 400000)',1,3);
lh = s.addlistener('DataRequired', ...
@(src,event) src.queueOutputData(data));
s.queueOutputData(data)
s.startBackground();
pause();
s.stop();
delete(lh);
delete(s);
  댓글 수: 5
Tao Cui
Tao Cui 2017년 3월 31일
I also have this issue with NI in daq session. When both digital and analog channels are presented in the session and when the task is started in background, memory keeps growing and eventually Matlab crashes with out of memory error. If there are only analog channels, everything will be fine.
The version I have is R2015b. It has been a while since this post, could you let me know if you found a solution.
Walter Roberson
Walter Roberson 2017년 3월 31일
Tao Cui: please note that previous participants do not receive email notification when Comments are added, so Josh and Andrea might not notice your request.

댓글을 달려면 로그인하십시오.

답변 (1개)

Tao Cui
Tao Cui 2017년 4월 25일
It seems this is really an old bug in Matlab DAQ toolbox. When there are two tasks (input and output, or digital and analog) running in background, this bug cause memory to blow up.

Community Treasure Hunt

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

Start Hunting!

Translated by