If bit 8 is set, the error occurred in the stream thread. Bit 10 is set for Windows API errors.
5 - Low-Level Function Reference
This section describes the bytes that are sent to the U12 over USB. Most users are going to use the functions provided by the UW
driver (Section 4).
This section is a valuable resource for anyone looking to interact directly with the U12.
Note that the LabJack U12 does not respond to the first command.
On the description of the commands, an ‘X’ means that the bit is ignored and can be set to either 0 or 1.
5.1 - AISample
This function reads from 4 analog inputs. It can also toggle the status LED and update the state of the IOs.
Bits 6-4: PGA for 1st Channel
Bits 3-0: MUX command for 1st Channel.
Bits 6-4: PGA for 2nd Channel
Bits 3-0: MUX command for 2nd Channel.
Bits 6-4: PGA for 3rd Channel
Bits 3-0: MUX command for 3rd Channel.
Bits 6-4: PGA for 4th Channel
Bits 3-0: MUX command for 4th Channel.
Bit 7-4: 1100 (Command/Response)
Bit 3-0: Bits for IO3 through IO0 States
Bits 3-0: Bits for IO3 through IO0 States
Bits 7-4: Most Significant Bits from 1st Channel
Bits 3-0: Most Significant Bits from 2nd Chanel
Least Significant Byte from 1st Channel
Least Significant Byte from 2nd Channel
Bits 7-4: Most Significant Bits from 3rd Channel
Bits 3-0: Most Significant Bits from 4th Chanel
Least Significant Byte from 3rd Channel
Least Significant Byte from 4th Channel
PGA Gain Setting – (Differential Only) 0b000 = 1, 0b001 = 2, 0b010 = 4, 0b100 = 8, 0b101 = 10, 0b110 = 16, 0b111 = 20
Mux Settings – 0b0000 = 0-1 (Differential), 0b0001 = 2-3 (Differential), 0b0010 = 4-5 (Differential), 0b0011 = 6-7
(Differential). Single-Ended readings = 0b1000 + AI Number.
LabJackPython Example
>>> import u12
45