Borrar filtros
Borrar filtros

Need to use an external trigger to initiate script commands

5 visualizaciones (últimos 30 días)
Stu McAfee
Stu McAfee el 26 de Oct. de 2015
Respondida: Rahul Goel el 28 de Oct. de 2015
I'm using Matlab to present stimuli for a series of experiments, and want to be able to precisely control the timing of their presentation based on external events. Previously I had been using TTL pulses through the parallel port, but that solution no longer works due to security updates which needed to be implemented by my university.
The script I was using for the trigger was as follows, using the daq legacy interface:
daqregister('parallel')
digin=digitalio('parallel','LPT1')
addline(digin, 0, 'in')
And the computer would idle when input was not received using:
while getvalue(digin)<1
...
end
This was embedded in a larger loop to show multiple stimuli. This solution worked very efficiently, so is there anything similar I could use if I purchased a USB device for the updated interface? Or is anyone aware of another simple solution, especially if I can use step voltage signals like TTL as the input? I'm using these commands in conjunction with psychtoolbox. Thank you!

Respuestas (1)

Rahul Goel
Rahul Goel el 28 de Oct. de 2015
Hi Stu,
It will help the community to assist you better if you could share more details about your setup. For example, what do you mean by external triggers? If you mean callback functions using the usb interface, you can refer to the following documentation:
Additionally, you can share the device details, and a sample workflow as well.

Categorías

Más información sobre Timing and presenting 2D and 3D stimuli en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by