ENOB stands for effective number of bits. The first ENOB column is the commonly used “effective” resolution, and can be thought
of as the resolution obtained by most readings. This data is calculated by collecting 128 samples and evaluating the standard
deviation (RMS noise). The second ENOB column is the noise-free resolution, and is the resolution obtained by all readings. This
data is calculated by collecting 128 samples and evaluating the maximum value minus the minimum value (peak-to-peak noise).
Similarly, the Noise Counts column is the peak-to-peak noise based on counts from a 12-bit reading.
Interchannel delay is the time between successive channels within a stream scan.
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.
Channel #
193
EIO_FIO
194
CIO
200
Timer0
201
Timer1
210
Counter0
211
Counter1
224
TC_Capture
230
Timer0 with reset
231
Timer1 with reset
240
Counter0 with reset
241
Counter1 with reset
Table 3.2.1-1. Special Stream Channels
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.
4 - LabJackUD High-Level Driver
The low-level U3 functions are described in Section 5, but most Windows applications will use the LabJackUD driver instead.
The latest version of the driver driver requires a PC running Windows XP or newer. The 3.07 version, supports Windows 98, ME,
2000. It is recommended to install the software before making a USB connection to a LabJack.
The download version of the installer consists of a single executable. This installer places the driver (LabJackUD.dll) in the
Windows System directory, along with a support DLL (LabJackUSB.dll). Generally this is c:\Windows\System\ on Windows 98/ME,
and c:\Windows\System32\ on Windows 2000/XP.
Other files, including the header and Visual C library file, are installed to the LabJack drivers directory which defaults to c:\Program
Files\LabJack\drivers\.
4.1 - Overview
The general operation of the LabJackUD functions is as follows:
Open a LabJack.
Build a list of requests to perform (Add).
Execute the list (Go).
Read the result of each request (Get).
At the core, the UD driver only has 4 basic functions: Open, AddRequest, Go, and GetResult. Then with these few functions, there
are many constants used to specify the desired actions. When programming in any language, it is recommended to have the
header file handy, so that constants can be copied and pasted into the code.
The first type of constant is an IOType, which is always passed in the IOType parameter of a function call. One example of an
IOType is the constant
LJ_ioPUT_DAC
, which is used to update the value of an analog output (DAC).
The second type of constant is a Channel Constant, also called a Special Channel. These constants are always passed in the
Channel parameter of a function call. For the most part, these are used when a request is not specific to a particular channel, and
go with the configuration IOTypes (
LJ_ioPUT_CONFIG
or
LJ_ioGET_CONFIG
). One example of a Special Channel is the
constant
LJ_chLOCALID
, which is used to write or read the local ID of the device.
The third major type of constant used by the UD driver is a Value Constant. These constants are always passed in the Value
parameter of a function call. One example of a Value Constant is the constant
LJ_tmPWM8
, which specifies a timer mode. This
constant has a numeric value of 1, which could be passed instead, but using the constant
LJ_tmPWM8
makes for programming
code that is easier to read.
Following is pseudocode that performs various actions. First, a call is done to open the device. The primary work done with this
call is finding the desired device and creating a handle that points to the device for further function calls. In addition, opening the
device performs various configuration and initialization actions, such as reading the calibration constants from the device:
24