LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Intergrate Tobii eye tracker with LabVIEWin real-time

Solved!
Go to solution

Hi! I'm trying to run the Tobii X3-120 tracker inside LabVIEW. My goal is to be able to tell the tracker to collect gaze data in REAL-TIME and transfer the collected data into LabVIEW for further analysis. I have been attempting so by modifying Tobii's python SDK and executing it with the "python node" and other relative controls inside LabVIEW. But no matter how I fix my codes in python, as long as it executes the "return" data command, the execution of python would stop for a moment (which means the tracker would also stop collecting data) in order to transfer the collected data into LabVIEW. This creates lags when I run the tracker in LabVIEW. Is there any way to overcome this problem or even better solutions? My ultimate goal is to run everything inside LabVIEW, while the tracker could continuously collect real-time data and calculate whether there are fixations and present the results with no lag (meaning as long as the tracker is collecting data, the fixation calculation/detection inside LabVIEW would not stop, and with no lag). Could anyone share some experience or advice? Thank you!

0 Kudos
Message 1 of 5
(1,256 Views)

What Real-Time NI hardware are you using to collect the data from the Eye-Tracker?  What is the nature of the signals that it is providing to you and how is it "timed"?  (I have some experience with eye-movement recordings).

 

Bob Schor

0 Kudos
Message 2 of 5
(1,233 Views)

Hi Bob, thanks for replying! I'm not using any NI hardware at the moment, the only hardware is the Tobii X3-120. The Tobii SDK could return gaze point coordinates in arrays and return them back into LabVIEW. I'm not sure I fully understand how it's timed, but the current condition is:

 

1. LabVIEW runs the python SDK in the background (using the python nodes in LabVIEW)

2. The tracker turns on for a few seconds (the exact time could be adjusted) and collects data

3. The SDK returns the data back into LabVIEW.

 

The problem is that the return part would turn off the tracker until it finishes returning the data into LabVIEW, which causes the tracker to always turns on and off and create lags, I want the tracker to collect data smoothly and continuously.

 

The attachment is the block diagram I have right now

0 Kudos
Message 3 of 5
(1,226 Views)
Solution
Accepted by topic author frankchen022

So, just FYI the term "real time" doesn't mean what you think it does. Real time in a programming sense is related to deterministic process timing, which isn't what you want here. I'd rephrase your requirement as "continuous".

 

Your problem is that you start and stop your code constantly. For a very quick benefit, take your Open and Close Python connections outside of the While loop. That loop currently starts and stops Python each time, which causes some of the delay you're seeing.

 

This will still result in your Python code being restarted over and over again. If you truly need it to continually send data, you could try writing Python code that continually loops and sends data to a Named Pipe, which can be read in LabVIEW:

https://forums.ni.com/t5/LabVIEW/how-to-read-a-data-from-a-named-pipe-in-windows-using-labview/td-p/...

 

0 Kudos
Message 4 of 5
(1,211 Views)

Thanks! That actually did fix the problem, I'll look into the other materials too.

0 Kudos
Message 5 of 5
(1,027 Views)