Psychtoolbox interfering with MATLAB Data Acquisition Toolbox

13 ビュー (過去 30 日間)
Albert Gerovitch
Albert Gerovitch 2018 年 3 月 23 日
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 件)

カテゴリ

Help Center および File ExchangeImage display and manipulation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by