# LabJack on linux to read in inputs/triggers for screen flips in matlab

**URL:** <https://psychtoolbox.discourse.group/t/labjack-on-linux-to-read-in-inputs-triggers-for-screen-flips-in-matlab/5650>\
**Category:** Programming Help\
**Tags:** linux, input-output, timing\
**Created:** [February 22, 2025, 7:25pm UTC](https://psychtoolbox.discourse.group/t/labjack-on-linux-to-read-in-inputs-triggers-for-screen-flips-in-matlab/5650 "2025-02-22T19:25:59Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Ian-Max-Andolina](https://yyz2.discourse-cdn.com/free1/user_avatar/psychtoolbox.discourse.group/ian-max-andolina/32/4_2.png) [@Ian-Max-Andolina](https://psychtoolbox.discourse.group/u/Ian-Max-Andolina)\
**Post date:** [March 1, 2025, 3:37am UTC](https://psychtoolbox.discourse.group/t/labjack-on-linux-to-read-in-inputs-triggers-for-screen-flips-in-matlab/5650/6 "2025-03-01T03:37:06Z")

</div>

1. Using a classic arduino and MATLAB’s current Arduino toolbox: T4 is much much better. this is mostly due to MATLAB’s terribly bloated arduino toolbox. I got variable delays \> 30ms.
2. Using the older MATLAB arduino toolbox (legacy version): T4 is faster than a classic arduino and not clearly slower than a more powerful USB3 Seeduino Xiao.

In general command-response (as you use with a TTL or strobed word) times are sub-millisecond on U and T series Labjacks. USB is a tiny bit slower than ethernet when I tested on a T4.

At least for digitial output, there isn’t a strong advantage of a LabJack over an arduino other than the hardware itself makes it a bit easier with the DB15 and screw terminals etc.

I haven’t test the latest Arduino Uno R4, but the previous generation were clearly slower than alternative arduino boards like the Xiao I mentioned above. Some performance code for different arduino’s and serial libraries can be found here: [https://psychtoolbox.discourse.group/t/serial-port-interface-code-a-performance-comparison](https://psychtoolbox.discourse.group/t/serial-port-interface-code-a-performance-comparison) – I imagine the new R4 would remove this gap…

---

_[View the full topic](https://psychtoolbox.discourse.group/t/labjack-on-linux-to-read-in-inputs-triggers-for-screen-flips-in-matlab/5650)._
