Command-response latency for the T4? | LabJack
 

Command-response latency for the T4?

6 posts / 0 new
Last post
iandol
iandol's picture
Command-response latency for the T4?

Hi, I used to use U6 with the exodriver under macOS and Linux, where I needed to send TTL triggers with low and reliable latency. The U6/U3 were incredibly reliable, with the lowest latency technically possible using USB2 and also really low variance.

The T4 uses a different driver and completely different low-level system, and I couldn't find the command-response latency for it in the datasheets. How does it compare to the U6/U3? What is the optimal driver /interface (usb vs. ethernet) to minimise latency?

I loved my U6s, and will buy them again, but the T4 has so many nice new features it is hard to resist! :-)

 

iandol
iandol's picture
To partly answer my own

To partly answer my own question, I find the currect documentation:

 

https://labjack.com/support/datasheets/t-series/appendix-a-1

 

Any advice would still be welcome in terms of minimal latency with Linux and MATLAB

LabJack Support
labjack support's picture
LJM is the recommended driver

LJM is the recommended driver/library for T4s. First, for the vast majority of applications, the names versions of LJM functions are appropriate.

For device read/write functions, LJM has two versions of each—names and addresses. Address versions don't have to look up the name to convert it to an address like the names versions do. The lookup is pretty quick. I recommend trying out the Examples\More\Testing\CRSpeedTest.m MATLAB example if you're curious what the difference is. Line 58 changes whether you use addresses or names:

useAddresses = true;

You could also adapt the CRSpeedTest example to use the LJM_WriteRaw/LJM_ReadRaw functions for an absolute minimal latency test.

Linux should work fine with the T4. Slow processors as you might find on a Raspberry Pi are not going to be as fast as regular desktop computers, of course.

The interval timer functions of LJM may be helpful to you, for the sake of performing read/write at a regular time period regardless of how long the read/write takes.

iandol
iandol's picture
Thanks as always for prompt

Thanks as always for prompt support and well designed products!

The MATLAB examples for Windows have a .NET dependency; for Linux/macOS what should we use instead?

 

iandol
iandol's picture
OK, thanks as always!!! I'm a

OK, thanks as always!!! I'm a bit confused by the MATLAB examples requiring .NET — what do we use in its place if we use Linux/macOS?

LabJack Support
labjack support's picture
The MATLAB examples are for

The MATLAB examples are for Windows and use the LJM .NET interface. We do not have Linux/macOS examples for MATLAB, but for those operating systems you will need to use the LJM library (libLabJackM.so) direct with the loadlibrary and calllib functions. libLabJackM.so is in the /usr/local/lib/ directory and the header file LabJackM.h is in the /usr/local/include/ directory.

The LJM library has documentation in its header file and in its User's Guide:

https://labjack.com/support/software/api/ljm