
Because the input bias current is known, as a function of input voltage, the simple voltage
divider equation can be modified as follows to account for input bias current:
R2 = Va / [((Vs-Va)/R1) – (8.181
µ
* Va) + 11.67
µ
]
As an alternative to the equation above, Va can be buffered by a single-supply rail-to-rail
operational amplifier, and the original simple voltage divider equation can be used. This
solution works for any single-ended signal which stays between 0 and +5 volts. Some op-amp
choices are:
•
TLV2462
•
LMC6482
•
MAX4166
Software
Readings from the analog inputs are returned by the functions AISample, AIBurst, and
AIStreamRead.
AISample returns a single reading of 1-4 channels, and takes up to 20 ms to execute, providing
a maximum date rate of at least 50 Hz per channel. This function also controls the status LED
and sets the state of the IO pins.
AIBurst acquires multiple samples of 1-4 channels at a hardware-timed sample rate of up to
8192 Hz. The acquisition can be triggered based on the change of state of an IO pin. This
function also controls the status LED and returns the states of the IO pins (which are read every
4 samples).
Internally, the actual number of samples collected and transferred by the LabJack during an
AIBurst call is the smallest power of 2, from 64 to 4096, which is at least as big as numSamples.
The execution time of this function, in milliseconds, can be estimated as (auto or turbo mode):
30+(1000*numSamplesActual/samp(0.4*numSamplesActual)
numSamples = numScans * numChannels
sampleRate = scanRate * numChannels
AIStreamRead is called periodically during a stream acquisition started by AIStreamStart. Each
call retrieves multiple samples of 1-4 channels from the LabJack stream buffer, along with the
states of the IO pins (read every 4 samples). Hardware-timed sample rates of up 1200 Hz are
available.
2.2 AO0 & AO1
The LabJack U12 has 2 screw terminals for analog output voltages. Each analog output can be
set to a voltage between 0 and the supply voltage (+5 volts nominal) with 10-bits of resolution.
The output voltage is ratiometric with the +5 volt supply, which is generally accurate to ±5% (see
Appendix A). If an output voltage of 5 volts is specified, the resulting output will be 100% of the
supply voltage. Similarly, specifying 2.5 volts actually gives 50% of the supply voltage.
If improved accuracy is needed, measure the +5 volt supply with an analog input channel, and
the actual output voltage can be calculated. For instance, if an analog output of 2.5 volts is