Syntax
Arguments
| Argument | Description |
|---|---|
NET | Name of the ADC net to read (optional if default is set) |
Options
| Option | Description |
|---|---|
--box TEXT | Lagerbox name or IP address |
--help | Show help message and exit |
Usage
Read ADC Value
Read voltage from an ADC net:List ADC Nets
When invoked without a net name (and no default is set), lists all available ADC nets:Supported Hardware
| Manufacturer | Model | Channels | Voltage Range | Input Mode |
|---|---|---|---|---|
| LabJack | T7 | 14 (AIN0-AIN13) | +/-10 V | Single-ended |
| Measurement Computing | USB-202 | 8 (CH0-CH7) | +/-10 V | Single-ended |
Hardware Comparison
| Feature | LabJack T7 | MCC USB-202 |
|---|---|---|
| Channel count | 14 | 8 |
| Channel names | AIN0-AIN13 | CH0-CH7 |
| Pin input format | 0-13 or AIN0-AIN13 | 0-7 or CH0-CH7 |
| Voltage range | +/-10 V (bipolar) | +/-10 V (bipolar) |
| Resolution | 16-bit (~0.3 mV/LSB) | 12-bit (~4.9 mV/LSB) |
| Connection | Shared handle (with DAC, GPIO, SPI) | Per-transaction open/close |
| Device selection | Auto-discovered (no address needed) | Via serial number or VISA address |
Channel Naming
When creating ADC nets, the channel name depends on the hardware: LabJack T7:0-13 map to AIN0-AIN13 internally.
MCC USB-202:
0-7 and named pins CH0-CH7 are both accepted. Channel names are case-insensitive.
Instrument Name Matching
The backend driver is selected based on the instrument name in the net configuration:| Pattern | Driver |
|---|---|
labjack + t7 (case-insensitive, flexible separators) | LabJack T7 |
mcc + usb + 202 (case-insensitive, flexible separators) | MCC USB-202 |
Default Net
Set a default ADC net to avoid specifying the name each time:Examples
Scripting Example
Notes
- Results are returned in volts with 6 decimal places
- Both hardware backends support bipolar measurement (+/-10 V range)
- ADC nets must be configured before use with
lager nets create <name> adc <channel> <address> - Default net can be set with
lager defaults add --adc-net - LabJack T7 shares a connection handle with DAC, GPIO, and SPI operations on the same device
- USB-202 opens and closes the connection on each read
- Use
lager instruments --box <box>to verify the ADC device is detected

