gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 22:22:17 24 4
gpt4 key购买 nike

我在 Win7 64 位操作系统上使用 PsychoPy standalone v1.81.00 发送脑电图记录触发器时遇到问题。我按照描述 here并且不会出现任何(更多)错误。但是,触发器不会显示在记录计算机(Win7 32 位下的 Brainvision Recorder)上。

我做了什么:

  1. 下载并安装了 InpOutBinaries_1500通过 InpOutBinaries_1500\Win32\InstallDriver.exe
  2. 将其他文件(inpout32.dll、.h 和 .lib 以及 vssver2.scc)复制到我的脚本的工作目录
  3. 尝试使用 windll.inpout32.Out32(0x378, triggerCode) 发送触发代码

触发代码未显示在 Brainvision Recorder 中,但在调用 print str(windll.inpout32.Inp32(0x378)) 时似乎设置正确。

感谢您的每一条建议或想法!

最佳答案

我设法解决了这个问题。我不完全确定哪一步实际上削减了曲线,但我建议如下:

下载并安装 LPT Test Utility在您的演示计算机上。

首先,无论您使用的是 32 位还是 64 位操作系统,该程序都会自动正确地安装 inpout32.dll。此外,它还可以帮助您监控和操作并行端口的引脚。如果使用标准地址(LPT1LPT3)不起作用,请选择 LPTX 并手动输入您的地址 (see here where to get your parallel port address on a Windows PC)。如果触发器没有显示在使用此程序的记录计算机上,则您遇到了与 PsychoPy 无关的问题。

如果失败,(重新)安装并行端口驱动程序。使用 Windows 7 这不是必需的,但实际上为我解决了一个主要问题。如果仍然失败,可能是硬件组件(并口插头/卡、电缆、同步盒)损坏。

如果触发器与“LPT 测试实用程序”程序一起工作但不使用 PsychoPy,则需要根据您的代码进行单独的故障排除。当然,您需要在您的 PsychoPy 代码中插入与“LPT 测试实用程序”一起使用的端口地址。

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

祝愿

马里奥

关于python - PsychoPy 在 64 位操作系统上发送触发器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26762015/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com