labjack good news

557 views
Skip to first unread message

Jonathan Peirce

unread,
Jan 7, 2011, 11:39:30 AM1/7/11
to psychop...@googlegroups.com
Hi there folks

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.

F0000TEK.TIF

Yaroslav Halchenko

unread,
Jan 7, 2011, 12:42:12 PM1/7/11
to psychop...@googlegroups.com
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?

--
=------------------------------------------------------------------=
Keep in touch www.onerussian.com
Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic

Jonathan Peirce

unread,
Jan 9, 2011, 5:02:18 AM1/9/11
to psychop...@googlegroups.com


On 07/01/2011 17:42, Yaroslav Halchenko wrote:
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?

Edmund Optics NT53-373 photodetector, which attaches directly to a BNC cable. Sorry, calling it a photometer wasn't strictly accurate - you can't measure a light intensity as a numeric value. They're under £100 and very handy (with an oscilloscope) for checking monitor timing stuff.

Jon
-- 
Dr. Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk/
Reply all
Reply to author
Forward
0 new messages