Psychtoolbox interfering with MATLAB Data Acquisition Toolbox
14 次查看(过去 30 天)
显示 更早的评论
Hello,
I am writing software in MATLAB that collects certain data from an external device, while using Psychtoolbox for timing. However, when I add a listener to that device, using the MATLAB Data Acquisition Toolbox, and use the WaitSecs function of Psychtoolbox, the listener does not function properly. When I run the same code with MATLAB's built-in (yet much less accurate) pause() function, everything works properly.
For example, in this code, when the pause() function is replaced with WaitSecs, the data is no longer collected from the device:
s = daq.createSession('ni');
ai=s.addAnalogInputChannel('Dev1','ai0','Voltage');
ai.TerminalConfig='SingleEnded';
s.Rate = (1000);
s.DurationInSeconds = 5;
s.IsNotifyWhenDataAvailableExceedsAuto = true;
lh = s.addlistener('DataAvailable', @(src, event)function(src, event));
s.IsContinuous = true;
s.startBackground;
pause(1);
s.stop;
delete(lh);
If anyone has worked with Psychtoolbox in combination with the Data Acquisition Toolbox before, could you please suggest some tips?
Thank you!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image display and manipulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!