Skip to main content
Read a single-ended analog voltage from an ADC net on a LabJack, MCC or similar acquisition device.

Handle

The handle is cheap and does no I/O until you call a method. The box resolves and validates the net name on every request, so a typo fails loudly rather than reading the wrong pin.

Methods

Method Reference

name() -> &str

The net name this handle was created with. Does not touch the network.

read() -> Result<f64>

Read the voltage present on the ADC input, in volts.
Returns: f64 — the measured voltage in volts. Signed: a negative reading is a real negative voltage, not an error.

Examples

Assert a rail came up

Poll a decaying rail

read() is a single cheap request, so polling in a loop is reasonable.

Supported Hardware

Notes

  • Readings are volts, always. There is no unit selection on this net type.
  • An unconnected input floats; a reading near zero on a disconnected pin is the instrument reporting noise, not a failure.
  • Each ADC net is one channel. A device with fourteen inputs is fourteen nets.
  • The box serializes access per physical instrument, so concurrent reads across several ADC nets on one device queue rather than interleave.