3.2.1 - Streaming Digital Inputs, Timers, and Counters
There are special channel numbers that allow digital inputs, timers, and counters, to be streamed in with analog input data.
Special Channels:
193: Returns the input states of 16 bits of digital I/O. FIO is the lower 8 bits and EIO is the upper 8 bits.
194: Returns the input states of 16 bits of digital I/O. CIO is the lower 8 bits.
200-201 and 210-211: Retrieves the least significant word (LSW, lower 2 bytes) of the specified timer/counter. At the same time that any one of these is sampled, the most significant word (MSW, upper 2 bytes) of that particular timer/counter is stored in an internal capture register (TC_Capture), so that the proper value can be sampled later in the scan. For any timer/counter where the MSW is wanted, channel number 224 must be sampled after that channel and before any other timer/counter channel. For example, a scan list of {200,224,201,224} would get the LSW of Timer0, the MSW of Timer0, the LSW of Timer1, and the MSW of Timer1. A scan list of {200,201,224} would get the LSW of Timer0, the LSW of Timer1, and the MSW of Timer1 (MSW of Timer0 is lost).
230-231 and 240-241: These channels perform the same operation as their 200-211 counterpart above, then reset the timer or counter.
Adding these special channels to the stream scan list does not configure those inputs. If any of the FIO or EIO lines have been configured as outputs, timers, counter, or analog inputs, a channel 193 read will still be performed without error but the values from those bits should be ignored. The timers/counters (200-224) must be configured before streaming using normal timer/counter configuration commands.
The timing for these special channels is the same as for normal analog channels. For instance, a stream of the scan list {0,1,200,224,201,224} counts as 6 channels, and the maximum scan rate is determined by taking the maximum sample rate at the specified resolution and dividing by 6.
It is not recommended to stream timers configured in mode 2 or 3 (32-bit period measurement). It is possible for the LSW to roll, but the MSW be captured before it is incremented. That means that only the LSW is reliable, and thus you might as well just use the 16-bit modes.
Mode 11, the upper 32 bits of the system timer, is not available for stream reads. Note that when streaming on the U3, the timing is known anyway (elapsed time = scan rate * scan number) and it does not make sense to stream the system timer modes 10 or 11.
Search
Shopping Cart
Testimonials
-
Thank you so much for your quick response. I was struggling with this late last night when I sent the request, and now first thing this morning I have a helpful reply. [...] By the way the upgrading process is so painless, it's fantastic! May I congratulate you on a well developed product with great product support.
—Jason, Compac Sorting Equipment


Comments
#1
According to the Firmware page (and my own successful usage), channel 194 can be used for the MIO and CIO as of firmware 1.09 on the U3C. See http://labjack.com/support/u3/firmware-revision-history (click on "Older versions" under U3C). The current PDF Users Guide also fails to mention this fact.
It's also not clear from this doc what the NChannel should be for the digital PChannels. So, I used 31, which makes the most logical sense (and also works).
Channel 194 is currently not handled by upstream LabJackPython. I've fixed this in my fork (https://github.com/davclark/LabJackPython) and will submit a pull request.
#2
Your fix for channel 194 in LabJackPython is in our repository now on github. Thanks for pointing this out.