| Reference | Downloads | Github

How to use PsychoPy Builder to create a TMS experiment?


If this template helps then use it. If not then just delete and start from scratch.

OS Win10
PsychoPy version 1.90.2
Standard Standalone? (y/n) yes
What are you trying to achieve?:
I have built a behavioral experiment. the procedure is in the attachment. I want to add the TMS stimulation at the onset of the second image and end the offset of the second image.
So how to use the parallel port component? could you give me a template?

Because I am a novice. I hope the answer can be more detail.

2 parallel ports to 2 TMS coils

Hi, maybe you could read the documentation and specify your question more precisely? What exactly don’t you know / doesn’t work as expected?


Thanks for your reply!

the first picture is one trial in my experiment.
I have looked the document, I am not sure that it is right about the position of p_port?
I want to add the TMS simulation in the onset of imagetarget and end the offset of it.

the second picture is my setting about the p_port, but I am not sure it’s right?
and I don’t know how to set the start data and stop data.

Do you understand my question?


Thanks for the more concrete questions. We could not have known what the problem was.

In the p_port component, you need to set the Start to condition (not time(s)) because you have entered a condition (fx2 component is finished) instead of a time point.
In Stop data $, you can enter any number between 0-255. It’s the value that the parallel port sends. For example, you would see this number as a trigger on an EEG computer. Maybe your TMS machine needs a particular value (you could check its manual).


ok, thank you very much.
I will find the manual.
Is the position of p_port right?
The Start data is filled out 1?


If imagetarget starts when fx2 is finished in your paradigm, then the p_port position is correct, yes. To make the timing of the trigger more transparent, you could also set the Start of p_port to condition and enter $imagetarget.status==STARTED.

With the code above, the parallel port sends 1 when the target image starts and 0 again when it stops. Now you need to get your TMS machine to interpret this information correctly.


OK, thank you very much!