Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Non-blocking streaming read?


  • Please log in to reply
1 reply to this topic

#1 mikelwrnc

mikelwrnc
  • Members
  • 17 posts

Posted 20 November 2014 - 09:41 AM

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?



#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

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