Using Matlab to send triggers via parallel port

35 次查看(过去 30 天)
I am trying to use Matlab (with the psychophysics toolbox) to send triggers via a parallel port. We are using the following code that worked for us on an older computer but no longer works:
ioObj = io64;
status = io64(ioObj);
Our problem is that status is always 1 when it should be 0. Meaning that the matlab is unable to open the parallel port.
I have checked that the parallel port is installed properly under device manager and it is.
Please, if anyone knows how to solve this problem I woud love to hear from you!

采纳的回答

Hassaan
Hassaan 2024-1-15
The issue you are encountering with MATLAB and the Psychophysics Toolbox not being able to open the parallel port could be due to several reasons. Here are some troubleshooting steps to help you resolve the problem:
  1. Run MATLAB with Administrative Privileges:
  • Try running MATLAB as an administrator. Right-click on the MATLAB shortcut and select "Run as administrator." Sometimes, access to certain hardware resources like the parallel port requires elevated privileges.
  1. Ensure Parallel Port Driver and Compatibility:
  • Make sure that the parallel port driver is correctly installed and compatible with your computer's operating system. Check for any driver updates or compatibility issues.
  1. Check Parallel Port Settings:
  • Confirm that the parallel port settings in your BIOS are configured correctly. Parallel port modes (e.g., SPP, EPP, ECP) should match the mode expected by your code.
  1. Verify Parallel Port Access:
  • Ensure that no other application or device is using the parallel port while MATLAB is trying to access it. Sometimes, other software or drivers may claim ownership of the port.
  1. Use 32-Bit MATLAB:
  • If you are using a 64-bit version of MATLAB, try switching to a 32-bit version. Some parallel port interfaces may have compatibility issues with 64-bit MATLAB.
  1. Check Parallel Port Address:
  • Verify that you are using the correct parallel port address in your code. The address may differ between computers, so make sure it matches the actual address of your parallel port.
  1. Check for Parallel Port Hardware Issues:
  • Inspect the physical parallel port and cables for any hardware issues. Loose connections or damaged cables can prevent proper communication.
  1. Update Psychtoolbox:
  • Ensure that you are using the latest version of the Psychophysics Toolbox. Check for updates or patches that may address compatibility issues with your hardware.
  1. Test with Alternative Code or Toolbox Functions:
  • Try using alternative functions or code examples within the Psychophysics Toolbox for parallel port communication to see if the issue is specific to your code.
  1. Use Third-Party Libraries:
  • If the problem persists, consider using third-party libraries like InpOut32 (for Windows) or libparport (for Linux) for parallel port communication. These libraries may offer better compatibility.
  1. Operating System Compatibility:
  • Ensure that your operating system is compatible with parallel port access. Newer operating systems may have limitations or security restrictions on hardware access.
  1. Contact Technical Support:
  • If none of the above solutions work, consider contacting technical support for the Psychophysics Toolbox or your hardware manufacturer. They may have specific guidance or updates related to your hardware configuration.
Please note that accessing hardware ports directly can be system-specific and may require special permissions or configurations, depending on the operating system and hardware. It's essential to ensure that your hardware and software are compatible and configured correctly for parallel port access.
------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
Professional Interests
  • Technical Services and Consulting
  • Embedded Systems | Firmware Developement | Simulations
  • Electrical and Electronics Engineering
Feel free to contact me.
  7 个评论
Fernanda
Fernanda 2025-6-13
Hello
It seems like it is working, and it is recognizing the function ‘outp’ that I need.
But now the program is not running and it says:
"Error using AssertOpenGL
Problems detected in call to AssertOpenGL;
Error in PsychDefaultSetup (line 58)
AssertOpenGL;
Error in Experimento2TRSe (line 3)
PsychDefaultSetup(2);"
What can I do??

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Installation and Operational Settings 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by