简体   繁体   English

PsychoPy在64位操作系统上发送触发器

[英]PsychoPy sending triggers on 64bit OS

I have a problem with sending triggers for eeg recording using PsychoPy standalone v1.81.00 on a Win7 64bit OS. 我在Win7 64位操作系统上使用PsychoPy独立v1.81.00发送eeg录制触发器时遇到问题。 I followed the descriptions here and don't get any (more) errors. 我按照这里的描述,不会得到任何(更多)错误。 The triggers, however, don't show on the recording computer (Brainvision Recorder under Win7 32bit). 但是,触发器不会显示在录制计算机上(Win7 32bit下的Brainvision录制器)。

What I did: 我做了什么:

  1. Downloaded and installed the InpOutBinaries_1500 via InpOutBinaries_1500\\Win32\\InstallDriver.exe 通过InpOutBinaries_1500 \\ Win32 \\ InstallDriver.exe下载并安装InpOutBinaries_1500
  2. Copied the other files (inpout32.dll, .h and .lib as well as vssver2.scc) to the working directory of my script 将其他文件(inpout32.dll,.h和.lib以及vssver2.scc)复制到我脚本的工作目录
  3. Tried sending trigger codes with windll.inpout32.Out32(0x378, triggerCode) 尝试使用windll.inpout32.Out32(0x378, triggerCode)发送触发器代码

The trigger code doesn't show up in Brainvision Recorder but seems to be set correctly when calling print str(windll.inpout32.Inp32(0x378)) . 触发器代码没有显示在Brainvision Recorder中,但在调用print str(windll.inpout32.Inp32(0x378))时似乎设置正确。

Thanks for every piece of advice or idea! 感谢您的每一条建议或想法!

I managed to solve the problem. 我设法解决了这个问题。 I'm not entirely sure which step(s) actually cut the curve but I recommend the following: 我不完全确定哪个步骤实际上切断了曲线,但我建议如下:

Download and install LPT Test Utility on your presentation computer. 在演示计算机上下载并安装LPT Test Utility

At first, this program installs the inpout32.dll automatically and correctly regardless if you use a 32 or 64 bit OS. 首先,无论您使用32位还是64位操作系统,此程序都会自动且正确地安装inpout32.dll More over, it helps you to monitor and manipulate the pins of your parallel port. 此外,它还可以帮助您监视和操作并行端口的引脚。 If using the standard addresses ( LPT1 through LPT3 ) doesn't work, select LPTX and enter your address manually ( see here where to get your parallel port address on a Windows PC ). 如果使用标准地址( LPT1LPT3 )不起作用,请选择LPTX并手动输入您的地址( 请参阅此处在Windows PC上获取并行端口地址的位置 )。 If the triggers don't show on your recording computer using this program, you have an issue that is not related to PsychoPy. 如果使用此程序未在您的录制计算机上显示触发器,则您遇到与PsychoPy无关的问题。

If this fails , (re-)install a parallel port driver. 如果失败 ,(重新)安装并行端口驱动程序。 Using Windows 7 this should not be necessary but actually solved one major issue for me. 使用Windows 7这不是必要的,但实际上解决了我的一个主要问题。 If this still fails, probably the hardware components (parallel port plug / card, cable(s), sync box) are damaged. 如果仍然失败,可能是硬件组件(并行端口插头/卡,电缆,同步盒)损坏。

If the triggers work with the "LPT Test Utility" program but not using PsychoPy , an individual troubleshooting dependent on your code is necessary. 如果触发器使用“LPT测试实用程序”程序但不使用PsychoPy ,则需要根据您的代码进行单独的故障排除。 Of course, you need to insert the port address that worked with "LPT Test Utility" in your PsychoPy code. 当然,您需要在PsychoPy代码中插入使用“LPT Test Utility”的端口地址。

from psychopy import core
from ctypes import windll

windll.inpout32.Out32(portaddress, triggerCode) #sends the trigger with triggerCode being an integer between 0 and 255
core.wait(0.05) #wait 50ms
windll.inpout32.Out32(portaddress, 0) #deletes the trigger i.e. resets the pins

Best wishes, 最好的祝愿,

Mario 马里奥

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM