DAQ Toolbox: Continuous acquisition and generation locks Matlab up
2 次查看(过去 30 天)
显示 更早的评论
I'm new to the session-based data acquisition toolbox approach, but not new to data acquisition in general. Whenever I try to do a simultaneous, continuous acquisition and generation, Matlab locks up (i.e., I can't abort execution and have to shut down Matlab at the OS level). No errors or warnings. I'm using an NI PCI-6110 card in a Windows 7 machine with Matlab 2014a. Am I missing something? I couldn't find any relevant examples. The following code will reproduce the issue on my machine:
% Set up the session
s = daq.createSession('ni');
addAnalogInputChannel(s,'Dev3', 'ai0', 'Voltage');
addAnalogOutputChannel(s,'Dev3', 'ao0', 'Voltage');
s.Rate=2000;
sig=zeros(2500,1);
queueOutputData(s,sig)
% Set up the callbacks
storeData=@(src,event) stop(src);
putData=@(src,event) queueOutputData(src,sig);
addlistener(s,'DataRequired',putData);
addlistener(s,'DataAvailable',storeData);
s.NotifyWhenDataAvailableExceeds=500;
s.NotifyWhenScansQueuedBelow=500;
s.IsContinuous=true;
% Start the session
disp('Starting');
startBackground(s);
disp('Waiting');
s.wait(5);
It gets gummed up at s.wait. Technically, it should stop the first time it tries to retrieve data, but it never gets that far.
Thanks, Eric
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 National Instruments Frame Grabbers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!