Memory Issue with DAQ
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Tao Cui
el 31 de Mzo. de 2017
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
el 31 de Mzo. de 2017
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.
Respuestas (1)
Tao Cui
el 25 de Abr. de 2017
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 comentarios
Ver también
Categorías
Más información sobre Data Acquisition Toolbox Supported Hardware en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!