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!
Solved! Go to Solution.
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).
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
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: