EasyManua.ls Logo

LabJack U12 - 5 - Low-Level Function Reference; 5.1 - AlSample

LabJack U12
61 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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.
Command
Byte #
Description
0
Bit 7: X
Bits 6-4: PGA for 1st Channel
Bits 3-0: MUX command for 1st Channel.
1
Bit 7: X
Bits 6-4: PGA for 2nd Channel
Bits 3-0: MUX command for 2nd Channel.
2
Bit 7: X
Bits 6-4: PGA for 3rd Channel
Bits 3-0: MUX command for 3rd Channel.
3
Bit 7: X
Bits 6-4: PGA for 4th Channel
Bits 3-0: MUX command for 4th Channel.
4
Bits 7-2: XXXXXX
Bit 1: Update IO
Bit 0: LED State
5
Bit 7-4: 1100 (Command/Response)
Bit 3-0: Bits for IO3 through IO0 States
6
XXXXXXXX
7
Echo Value
Response
Byte #
Description
0
Bit 7: 1
Bit 6: 0
Bit 5: X
Bit 4: PGA Overvoltage
Bits 3-0: Bits for IO3 through IO0 States
1
Echo byte 7 from Command
2
Bits 7-4: Most Significant Bits from 1st Channel
Bits 3-0: Most Significant Bits from 2nd Chanel
3
Least Significant Byte from 1st Channel
4
Least Significant Byte from 2nd Channel
5
Bits 7-4: Most Significant Bits from 3rd Channel
Bits 3-0: Most Significant Bits from 4th Chanel
6
Least Significant Byte from 3rd Channel
7
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

Other manuals for LabJack U12