I'm using the python module to stream input from a labjack to a Mac. I notice that the device.streamData() call blocks until it has the configured data collected before returning. I also see mention of some ability in the C library ("LJ_chSTREAM_WAIT_MODE"?) to configure this behaviour and have the labjack not block. How do I set the wait mode via the python module?
Non-blocking streaming read?
Posted 20 November 2014 - 12:16 PM
LJ_chSTREAM_WAIT_MODE is a Windows UD driver only feature and is not available on Mac which uses the low-level USB driver Exodriver. If you are on Windows you can use the UD wrapper functions, which are in the LabJackPython module, to use wait mode like in section 4.3.7 (UD Stream Mode Pseudocode) in the User's Guide.
The streamData call will only block and attempt to read the configured amount of data. You can however make a thread to perform the streamData read loop and keep your main thread free for other operations.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users