Communicating with ASL eye tracker via parallel port

Using LiveCode in research or teaching of post secondary topics? Share your interests with other academics.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
rariel
Posts: 2
Joined: Tue Jun 30, 2009 6:59 pm

Communicating with ASL eye tracker via parallel port

Post by rariel » Wed Jul 08, 2009 5:57 pm

Hi everyone,

I've been using revolution for about a year for research and data collection. I love the flexibility that it gives me for experimental design. Recently my lab purchased an ASL Eye-Trac 6 and I'm interested in programming experiments in revolution that can communicate with the eye tracker control unit that is located on a separate computer. The reason I need to communicate with this control unit is so that I can tell the control unit when to start and stop recording (in addition to various other things).

I've already programmed experiments for this eye tracker using e-prime which is an experimental development studio that basically compiles visual basic script for you that runs the program. You can program in e-prime by simply knowing a limited amount of visual basic, which happens to be the case for me.

With e-prime you communicate with the eye tracker by sending values via the parallel port to the eye tracker control unit. For example if I want to tell the eye tracker to close a data file I use the following code:

writeport &H378, 0

The value 0 tells it to close a data file. Likewise, I can open a new data file by sending values 64 instead of 0. This is pretty easy way to communicate with the control unit with e-prime, but I tend to dislike e-prime as a whole and would rather use revolution to present my experiments because it gives me a greater degree of flexibility over what I can do in each experiment.

I've tried to compile script in revolution that would communicate with the eye tracker via the same method. Here is an example:

open file "LPT1:" for write
write 0 to file "LPT1:"
close file "LPT1:"

The above script did not work and it actually caused revolution to freeze up and crash. Does anyone know what I did wrong? I tried one alternative method to communicate via the parallel port using vb script, but this did not work either. Here is what I did:

put "writeport &H378, 0" into x
do x as vbscript

This script basically did nothing.

I'd love to hear any suggestions about how to send information via a parallel port. Or better yet, if anyone has already used revolution with an ASL eye tracker, I would be vary grateful to hear how you accomplished this. I'm still kind of a novice programmer, so any help is much appreciated.

Best,

Robert

planix
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 40
Joined: Tue Mar 10, 2009 12:47 pm

Re: Communicating with ASL eye tracker via parallel port

Post by planix » Fri Mar 05, 2010 8:31 am

Hi Robert,

I wonder if you got a reply to your post- apart from this one.

I am also interested in using rev with eye-tracking hardware. We built one in our lab for mobile eyetracking and the data stream is on a usb port. But, I haven't focused on whether I can use rev to set up an interface.

Looking at your code and some of the documentation on LPT1: I thought you might be able to just script this as

Code: Select all

open file "LPT1:
write "0" to file "LPT1:"
close file "LPT1:
so make the zero explicit

But I am no expert in this.

cheers

Alistair
James Cook University
Queensland
Australia
****************************************
PLANIX
"Knowing anything is better than knowing nothing. But knowing that nothing ain't anything, why that's just plain nirvana."

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5339
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Communicating with ASL eye tracker via parallel port

Post by FourthWorld » Fri Mar 05, 2010 3:39 pm

I'm very interested in learning more about what you're doing with eye tracking. Part of a usability study?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

planix
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 40
Joined: Tue Mar 10, 2009 12:47 pm

Re: Communicating with ASL eye tracker via parallel port

Post by planix » Fri Mar 05, 2010 11:56 pm

Hi,

I work in a Dept of Psychology and was interested in developing mobile eye-tracking, more like gaze tracking, for a couple of clinical applications. One was to develop a system for evaluating gaze and focus of attention in children with various disorders like ADHD, Aspergers, and Austism. I was also interested in using the equipment to look at gaze and attention in things like driving and navigating in the real world.

We put together a unit using the openEyes (http://thirtysixthspan.com/openEyes/) hardawre designs. The software is, however, built on linux and/or matlab and we don't really have the technical setup to implement that. One of my students who is also a programmer used the rig to look at eye movement and relationship to visual imagination but he wrote code to process the data from just the eye-directed camera. The rig has an eye-directed and a scene-directed camera and the openEyes software allows for real time tracking of gaze with a cross hair calibrated from the eye-directed camera superimposed on the input from the scene-directed camera.

My interest has been on whether I could develop a rev based application to do what the openEyes software does. Track gaze in real time and provide integrated video output which shows where the gaze is directed using a cross-hair based on information from the eye-directed camera. Our rig uses a remote connection to a pc using a usb port so the person can be wearing the rig and moving around whilst data is streamed to the pc somewhere else in the room.

It's all in draft stage at this point as I have got so many other things on. But, in the back of my mind is the plan to have a look at whether rev would be up to the speed of processing to do this in real time.

Is this something you would be interested in as well?

cheers

Alistair
****************************************
PLANIX
"Knowing anything is better than knowing nothing. But knowing that nothing ain't anything, why that's just plain nirvana."

rariel
Posts: 2
Joined: Tue Jun 30, 2009 6:59 pm

Re: Communicating with ASL eye tracker via parallel port

Post by rariel » Thu Mar 11, 2010 7:50 pm

Hi,

It's great to finally get some feedback!

Alistair, I didn't try your suggestion yet. However, I feel I may have tried that option when I was initially tinkering around with revolution and the eye tracker. I'll reply back later to let you know if it works.

I'm a psychology grad student and my research interests are in self-regulated learning. Specifically memory monitoring and control--or metacognition. I use revolution almost exclusively for data collection. I say almost, because I still have not been able to get revolution to work with our eye tracker, so I'm forced to use e-prime for data collection with the eyetracker. I have not really devoted much time to resolving this issue since my initial post because I have other things on my plate.

I'm definitely interested in hearing more about what you are doing, and please report back if you are successful.

For the purposes of my research, I really just need to be able to communicate with the control unit to tell the eye tracking software when to open or close a eyenal data file, and to start and stop recording during various phases of the experiment. I actually don't even need to use revolution to store or analyze eye tracking measures because the control unit will create a data file (using the eyenal software) that can be used to examine fixations, transitional activity, and pupil diameter. I know how to do all these things in e-prime, but I would prefer to say goodbye to e-prime forever and to do everything in revolution.

Good luck with your eye tracking endeavours! I look forward to hearing more about them later, and I'd be happy to offer suggestions for trouble shooting.

Best,

Robert

planix
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 40
Joined: Tue Mar 10, 2009 12:47 pm

Re: Communicating with ASL eye tracker via parallel port

Post by planix » Thu Mar 11, 2010 11:58 pm

Hi Robert,

I would wonder if you asked the question to the general forum on using Rev, rather than this academic forum, whether you might get some more response. I would have thought it a straightforward matter as you are simply wanting to read/write a virtual file.

The eyetracking stuff is pretty much on hold for us as we have the hardware rig but haven't put the effort into writing an interface that is generic enough to use the rig for whatever range of experiments we want to engage in. That's why I have been looking at revolution. I am a hack coder with some experience with Delphi, VB, and python but not the expertise on the hardware interface stuff. My main focus is not so much on eye tracking as gaze tracking- what are people looking at and how do they do that. A range of interests including the dysfunction of gaze and it's relationship to information processing in children with ADHD, ASD, etc but also the pattern of visual attention in driving and other skilled tasks. As I said in an earlier post, my student who was a programmer used the rig to look at eye movement and internal visual imagination. But, that is a really limited use.

I think that part of my problem in using rev for this will be the speed of data acquisition as I really want to integrate two video streams (an eye focused cam + a scene focused cam) in real time. This seems to me to a pretty intensive processing task and I am really not sure whether rev is up to the maths of locating eye direction and translating that to a point in space on another video stream.

Anyway, once I get some more time I'll keep playing around and let you know how it goes.

cheers

Alistair
****************************************
PLANIX
"Knowing anything is better than knowing nothing. But knowing that nothing ain't anything, why that's just plain nirvana."

Post Reply

Return to “Research and Post Secondary”