I recently bought a labjack (labjack.com) to test its latency to be used
as a device for sending trigger pulses on machines that no longer have
parallel ports. It was really easy to install and really does have a low
latency, at least for trigger outputs on the digital output (TTL)
channels. In fact it performed perfectly. This means we really can do
away with the old-fashioned-but-easy-and-precise parallel port! :-)
The attached file was the oscilloscope output of the script below,
recorded using a fast photometer attached to the CRT screen (centre) and
a labjack U3 channel FIO4 being set high (via the standard labjack
python lib) while the stimulus is bright. The sync is perfect, with the
labjack signal rising slightly before the screen one (because the beam
takes a while to get to the middle of the screen from the top).
So, the new advice for people wanting to send sync pulses to EEG
machines is to buy a labjack and do the following! Or buy a computer
with a parallel port and use the psychopy parallel port demo.
enjoy!
Jon
""" demo for using labjack DAC devices
See also
http://labjack.com/support/labjackpython
"""
from psychopy import visual, core, event
from labjack import u3
win = visual.Window([800,800])
stim = visual.PatchStim(win, color=-1, sf=0)
#setup labjack U3
ports = u3.U3()
FIO4 = 6004 #the address of line FIO4
ports.writeRegister(FIO4,0)#start low
#draw black square
stim.draw()
win.flip()
#wait for a key press
event.waitKeys()
#set to white, flip window and raise level port FIO4
stim.setColor(1)
stim.draw()
win.flip()
ports.writeRegister(FIO4,1)#send immediately AFTER the flip
for frameN in range(4):
stim.draw()
win.flip()
#set color back to black and set FIO4 to low again
stim.setColor(-1)
stim.draw()
win.flip()
ports.writeRegister(FIO4,0)#send immediately AFTER the flip
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
On Fri, 07 Jan 2011, Jonathan Peirce wrote:
> recorded using a fast photometer attached to the CRT screen (centre)
which photometer did you use?
--
=------------------------------------------------------------------=
Keep in touch www.onerussian.com
Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic
awesome On Fri, 07 Jan 2011, Jonathan Peirce wrote:recorded using a fast photometer attached to the CRT screen (centre)which photometer did you use?
-- Dr. Jonathan Peirce Nottingham Visual Neuroscience http://www.peirce.org.uk/