I am trying to send a TTL trigger from Qualisys Track Manager (QTM) via a BNC cable to a computer running PsychoPy. I am not quite sure what the best way to interface the BNC cable with the computer would be, as it is a laptop with only USB A, USB C, and an HDMI port.
Ideally, QTM would start a data capture and send a single square wave to PsychoPy, and PsychoPy (which would be started, and at a wait screen waiting for an input) would receive the square wave and start a trial. What is the best way to convert the signal into something PsychoPy can understand?
I see that under I/O PsychoPy only has Parallel Out and Serial Out options. Are there any Python packages which can allow PsychoPy to accept inputs?
QTM has the capability to initiate a recording using a UDP packet. Furthermore, upon starting, it sends out a UDP packet that can be intercepted by Psychopy to trigger an experiment. However, there are certain considerations to keep in mind, especially concerning timing.
Additionally, for practical implementation, you might find this Python program useful for sending and receiving these packets: GitHub - ulvs/udp_trigger.
Extra post due to the 2 link minimum for new members…
Hi, thanks for the info! I was able to successfully start a QTM capture from a Python script using this info. For future reproducibility, here is the Python code I used. The ‘host’ object is the IPv4 Address of the computer where QTM is installed.