Memory Issue with DAQ
4 次查看(过去 30 天)
显示 更早的评论
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
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
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
2017-4-25
Check out my answer in this post: https://www.mathworks.com/matlabcentral/answers/279857-daq-toolbox-memory-leak
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Acquisition Toolbox Supported Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!