Skip to main content
Read analog-to-digital converter (ADC) values from your box. Supports LabJack T7 and MCC USB-202 hardware with per-hardware channel naming and voltage ranges.

Syntax

Arguments

Options

Usage

Read ADC Value

Read voltage from an ADC net:
Output:
The result is returned in volts with 6 decimal places.

List ADC Nets

When invoked without a net name (and no default is set), lists all available ADC nets:
Output:

Supported Hardware

Hardware Comparison

Channel Naming

When creating ADC nets, the channel name depends on the hardware: LabJack T7:
Numeric pins 0-13 map to AIN0-AIN13 internally. MCC USB-202:
Numeric pins 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:

Default Net

Set a default ADC net to avoid specifying the name each time:
Then:

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 add <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

See Also

  • DAC — Digital-to-analog converter output (the complement of ADC)
  • Python ADC API — Read ADC values in Python scripts