Hardware and Environment: I have a U3 (purchased in 2013), and I have successfully installed exodriver on Ubuntu 14.04 LTS from the Labjack github page. I can run the all of the examples without errors.
Goal: I would like to do streaming analog input on two channels within a larger C++ program. This larger program is an OpenGL-based graphics program. There is a main loop, in which each iteration (graphics frame) lasts about 16.7 msec (corresponding to a frame rate of 60Hz). During each frame (i.e. main loop iteration), I would like to read all of the available data on the U3 buffer into my own, userspace buffer. It does not matter whether there is variability in the amount of available data on each iteration - I just want to read everything that's there quickly and move on, so that nothing is blocking and slowing down the frame rate. For my application, I need scan rates of at least 5kHz, preferably closer to 10 kHz. For the 10 kHz scan rate, this corresponds to loading the U3 buffer with 334 samples per frame, which I think is within its limits (512-984 samples).
What I have learned from the docs: In section 4.3.7 of of the "high level driver" documentation (Windows only), streaming mode is described in detail. From this discussion, the "wait mode" I need corresponds to LJ_swNONE.
Where I am totally lost: The "low-level" exodriver functions for configuring the U2, and configuring streaming mode seem to require a deep knowledge of byte-by-byte communication with the U3 and the details of U3 operation. To be more specific, I will refer to the u3Stream.c file included with exodriver examples (attached).
In the ConfigIO_example function, which bytes of the sendBuff should I modify and what values should I use to obtain a configuration in which I have two analog inputs (single ended), say aIN0 and aIN1?
In the StreamConfig_example function, again, which bytes of the sendBuff should I modify to obtain two single-ended analog inputs? Furthermore, how can I set the scan rate ... using scanInterval?
Apology: I realize that it might require a novel-length response to fully answer these questions ... i.e. a rundown of exactly how the U3 works. Or maybe not? If someone could refer me to the relevant documentation that would answer my questions that would be great. Generally, I could really use an overview of how timers and counters, and FIOAnalog and EIOAnalog should be configured. Also if there is any "higher level" interface on the Linux platform that could do what I need to do, please let me know! Thanks! ... and sorry! Sadly, I am a biologist and not an engineer.