If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10): Win7
PsychoPy version (e.g. 1.84.x): 2020.1.3
Standard Standalone? (y/n) If not then what?: y
**What are you trying to achieve?:
I am try to set up a fMRI experiment using psychopy. However I cannot work out how to get triggers send from the scanner (a Phlips Achieva 3T).
There is no hardware damage - I can read triggers successfully using E-Prime. And when I set the readPin to port.readPin(12), which is always up, I keep got ones.
What did you try to make it work?:
I have installed parallel port drivers (inpout32.dll) in both the programe folder and System32. And, I have set up a Routine Named âPPconfigâ at the beginning of the experiemt. In this routine, I used the following codes:
Begin Experiement:
from psychopy import parallel
port = parallel.ParallelPort(0xC100)
pinvalue = 0
triggertime = 0
Each Frame:
pinvalue = port.readPin(10) #read pin 12 or 10
if pinvalue != 0:
triggertime = core.getTime()
logging.exp(âtrigger recived: start of scanâ)
continueRoutine = False
I also have a text component said âwaiting for triggerâŚâ in this routine, which suppose to present till trigger was recived.
It seems that someone get it wordked used while True: loop, I have also tried it in my set up, as follows:
Begin Experiement:
from psychopy import parallel
port = parallel.ParallelPort(0xC100)
pinvalue = 0
triggertime = 0
Begin Routine:
while True:
if port.readPin(10) != 0:
break
logging.exp(âtrigger recived: start of scanâ)
continueRoutine = False
The programe got stucked. Then I learned that while loop cannot work with builder view from Ending loop conditionnally. While loop?. So I turned to each frame.
**What specifically went wrong when you tried that?:
When I am reading Pin 10, using âpinvalue = port.readPin(10)â the programe stucked at the waiting screen, seems it get nothing from the parallel port. Though I have tried every input pins I can recognize, I am not sure if I have read the wrong Pin or I have missed something in my code. Also, as I am not familar with how the trigger works, I am not sure in the case of getting trigger from scanner do I just use readPin or do I have to send something to the scanner first? And is there anyway I could read more pins? Actually, is there an example for getting triggers from fMRI?
I am very lost on how to fix this. Does anyone have any advice?
Include pasted full error message if possible. âThat didnât workâ is not enough information.