Skip to main content
Skip table of contents

MATLAB/Psychtoolbox

Invalid MEX-file or Datapixx(‘Open’) fail in MATLAB

This error is usually caused by an outdated MATLAB executable (.mex file) in your Psychtoolbox folder. This file must be manually updated each time you update VPixx Software Tools. Please follow the steps on this page: Introduction to VPixx MATLAB documentation

MATLAB -1010 error or MATLAB script freezes and crashes

There are many possible reasons for this error, but common culprits are the following commands:

RegWrVideoSync
RegWrPixelSync

Both of these commands instruct your VPixx hardware to perform a register write when a specific event is detected in the video signal. They are non-blocking commands, so the rest of your MATLAB code will continue to run. However, your device is now in a “busy” state while it waits for the event, and any further attempts to perform a write or write-read to the device register will be queued until the event is detected and the write can execute.

Queuing many attempts to write to or read from the device register while it is “busy” can throw errors and crash your program. If this is happening to you, most likely your VideoSync or PixelSync commands are waiting for a very long time for their triggering event (or the event just doesn’t happen) and this is causing subsequent attempts to communicate with the device to stack up and crash the program.

If you are not using either of these commands in your code, you may want to check and see if one of your PsychDataPixx commands might be using them “under the hood.” PsychDataPixx commands that reference timing are almost certainly using these sync functions.

To fix these errors, please ensure the following:

  • Video is running through your VPixx hardware to the display 

  • Your script calls VideoSync and PixelSync commands (or the PsychDataPixx functions invoking them) right before the screen flip which should trigger them, so there will be little delay

  • For PixelSync: You are not applying blending, anti-aliasing or other display changes which could alter your PixelSync trigger after you have set it

  • For PixelSync: Your graphics card is not dithering. Check out our guide to diagnosing and disabling dithering to learn more.

If these sync functions are not relevant or you want to get around them for debugging purposes, both functions have a timeout argument that can be set to 1-2 frames to cause them to execute right away and prevent queuing subsequent commands. Doing this renders their sync function useless and will definitely mess up any timing or synchronization that depends on them. We do not recommend doing this during data collection.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.