Skip to main content

Power API Reference

The Power API provides control over programmable power supplies for Device Under Test (DUT), USB ports, and current measurement through relay 0. The DUT channel supplies 1.6โ€“13 V programmable, or a fixed 24 V at up to 2A with precise current monitoring.

Accessing Powerโ€‹

const power = tester.power;

Power Module Methodsโ€‹

reset()โ€‹

Resets all power supplies to their default state: the DUT supply and both USB ports are switched off, and the DUT target_voltage returns to 0. The outputs are not discharged: see Dut.disable() and Usb.disable().

await tester.power.reset();

Returns: Promise<void> / None / Result<(), At1000Error>


dut(id)โ€‹

Access a specific DUT power supply channel.

const dut0 = tester.power.dut(0);

Parameters:

  • id (number / int / usize): DUT channel identifier (0-based)

Returns: Dut / PowerDut / Result<Dut, At1000Error>. The handle exposes its channel number as id (id() in Rust).


usb(id)โ€‹

Access a specific USB port for power control and monitoring.

const usb0 = tester.power.usb(0);

Parameters:

  • id (number / int / usize): USB port identifier (0-based, typically 0-1)

Returns: Usb / PowerUsb / Result<Usb, At1000Error>. The handle exposes its port number as id (id() in Rust).


relay_0()โ€‹

Access the power-measurement relay for high-precision current measurement.

const relay0 = tester.power.relay_0();

Returns: RelayPower instance / RelayPower in Rust (not a Result). In JavaScript and Python the handle exposes id, always 0; the Rust RelayPower has no id().

note

This is a special relay with current measurement capability. Current measurement is done using a 0.33 Ohm shunt resistor, providing 1ยตA resolution up to 500mA.


Dut Classโ€‹

Programmable power supply for powering and testing devices.

reset()โ€‹

Resets the DUT channel to its default state: switched off, with target_voltage 0. Like disable(), it does not discharge the output.

await dut.reset();

Returns: Promise<void> / None / Result<(), At1000Error>


configure(config)โ€‹

Configures the DUT power supply.

await dut.configure({
enabled: true,
target_voltage: 3.3
});

Parameters:

  • config (DutConfiguration; in Python, keyword arguments):
    • enabled (boolean / bool / Option<bool>, optional): Enable or disable the supply
    • target_voltage (number / float / Option<f64>, optional): Target voltage (1.6โ€“13 V, or 24 V)

Returns: Promise<DutState> / PowerDutState / Result<DutState, At1000Error> - The new enabled and target_voltage. voltage and current are the values measured by the last read(), read_voltage() or read_current() (0 if none since power-on or reset()), not a fresh measurement: call read() to measure the output.

Exceptions:

  • OUT_OF_RANGE_VALUE (HTTP 400) if target_voltage is outside 1.6โ€“13 V and is not 24 V (the device also accepts a value less than 10 mV below 24 V). The check also applies when the same call sets enabled to false, and a rejected call changes nothing
  • JavaScript throws a validation error before sending if target_voltage is outside ยฑ25 V. Rust returns InvalidInput before sending if target_voltage is outside 1.6โ€“13 V and is not exactly 24.0, including when enabled is Some(false)

enable(voltage)โ€‹

Enables the DUT power supply at the specified voltage.

await dut.enable(12.0); // Enable at 12V

Parameters:

  • voltage (number / float / f64): Target voltage (1.6โ€“13 V, or 24 V)

Returns: Promise<DutState> / PowerDutState / Result<DutState, At1000Error> - As for configure(): voltage and current are the values of the last read, not a fresh measurement

Exceptions:

  • OUT_OF_RANGE_VALUE (HTTP 400) if voltage is outside 1.6โ€“13 V and is not 24 V. A rejected call leaves the supply unchanged
  • JavaScript throws a validation error before sending if voltage is outside ยฑ25 V. Rust returns InvalidInput before sending if voltage is outside 1.6โ€“13 V and is not exactly 24.0

set_target_voltage(voltage)โ€‹

Changes the target voltage without enabling or disabling the supply. This method exists only in Rust; in JavaScript and Python, call configure() with target_voltage alone.

let dut = tester.power.dut(0)?;
dut.set_target_voltage(5.0)?; // Change the target to 5V, keep the enabled state

Parameters:

  • voltage (f64): Target voltage (1.6โ€“13 V, or 24 V)

Returns: Result<DutState, At1000Error> - As for configure(): voltage and current are the values of the last read, not a fresh measurement

Exceptions:

  • Returns InvalidInput before sending if voltage is outside 1.6โ€“13 V and is not exactly 24.0

disable()โ€‹

Switches the DUT power supply off. The target voltage is kept.

await dut.disable();

Returns: Promise<DutState> / PowerDutState / Result<DutState, At1000Error> - State with enabled: false. As for configure(), voltage and current are the values of the last read, not a fresh measurement

The output is not discharged

disable() and reset() switch the supply off but do not discharge the output: the voltage decays at a rate set by the load and its capacitance. With no load, a 12 V output takes about 9 s to fall below 1 V (typical measurement). Before enabling the supply again when the device under test needs a full power cycle, poll read_voltage() until it falls below the level your device needs.


read()โ€‹

Reads the complete state of the DUT supply. voltage and current are measured by this call. target_voltage is 0 until a target voltage has been set after power-on or reset().

const state = await dut.read();
console.log("Enabled:", state.enabled);
console.log("Target:", state.target_voltage, "V");
console.log("Actual:", state.voltage, "V");
console.log("Current:", state.current, "A");

Returns: Promise<DutState> / PowerDutState / Result<DutState, At1000Error> - Full state object


read_current()โ€‹

Reads only the current drawn by the DUT.

const current = await dut.read_current();
console.log("Current:", current, "A");

Returns: Promise<number> / float / Result<f64, At1000Error> - Current in amperes


read_voltage()โ€‹

Reads only the actual output voltage.

const voltage = await dut.read_voltage();
console.log("Voltage:", voltage, "V");

Returns: Promise<number> / float / Result<f64, At1000Error> - Voltage in volts


Usb Classโ€‹

USB port power control with monitoring capabilities.

reset()โ€‹

Resets the USB port to its default state (switched off). Like disable(), it does not discharge the port.

await usb.reset();

Returns: Promise<void> / None / Result<(), At1000Error>


configure(config)โ€‹

Configures the USB port power.

await usb.configure({
enabled: true
});

Parameters:

  • config (UsbConfiguration; in Python, the keyword argument enabled):
    • enabled (boolean / bool / bool, required): Enable or disable USB power

Returns: Promise<UsbState> / PowerUsbState / Result<UsbState, At1000Error> - State including the voltage and current measured right after the change


enable()โ€‹

Enables USB port power.

await usb.enable();

Returns: Promise<UsbState> / PowerUsbState / Result<UsbState, At1000Error> - State with enabled: true, measured right after the change


disable()โ€‹

Switches USB port power off.

await usb.disable();

Returns: Promise<UsbState> / PowerUsbState / Result<UsbState, At1000Error> - State with enabled: false, measured right after the change, before the port voltage has decayed

The port is not discharged

disable() and reset() cut the port's power but do not discharge it: the voltage decays at a rate set by the connected device. With no device connected, a port still reads about 2.6 V 15 s after disable() and takes about 130 s to fall below 0.5 V (typical measurement). To power cycle a device, poll read_voltage() until it falls below the level at which your device resets before calling enable() again.


read()โ€‹

Reads the complete current state of the USB port.

const state = await usb.read();
console.log("Enabled:", state.enabled);
console.log("Voltage:", state.voltage, "V");
console.log("Current:", state.current, "A");

Returns: Promise<UsbState> / PowerUsbState / Result<UsbState, At1000Error> - Full state object, measured by this call


read_current()โ€‹

Reads only the current drawn through the USB port.

const current = await usb.read_current();
console.log("USB Current:", current, "A");

Returns: Promise<number> / float / Result<f64, At1000Error> - Current in amperes


read_voltage()โ€‹

Reads the USB port voltage.

const voltage = await usb.read_voltage();
console.log("USB Voltage:", voltage, "V");

Returns: Promise<number> / float / Result<f64, At1000Error> - Voltage in volts


RelayPower Classโ€‹

Relay 0 with high-precision current measurement capability.

read()โ€‹

Reads the complete state including current measurement.

const state = await relay0.read();
console.log("Current through relay:", state.current, "A");

Returns: Promise<RelayState> / RelayPowerState / Result<RelayPowerState, At1000Error> - State object with current measurement


read_current()โ€‹

Reads only the current flowing through the relay.

const current = await relay0.read_current();
console.log("Relay 0 Current:", current, "A");

Returns: Promise<number> / float / Result<f64, At1000Error> - Current in amperes

note

Relay must be closed for current to flow and be measured. Bidirectional current measurement is supported.


Typesโ€‹

DutStateโ€‹

{
enabled: boolean,
target_voltage: number, // 1.6โ€“13 V, or 24 V; 0 until a target has been set
voltage: number, // Measured voltage
current: number // Measured current in amperes
}

Python: ikalogic_at1000.PowerDutState, with the same fields.

Rust: ikalogic_at1000::DutState

pub struct DutState {
pub enabled: bool,
pub target_voltage: f64,
pub voltage: f64,
pub current: f64,
}

DutConfigurationโ€‹

{
enabled?: boolean,
target_voltage?: number // 1.6โ€“13 V, or 24 V
}

Python: ikalogic_at1000.PowerDutConfiguration, with the same fields. configure() builds it from its keyword arguments.

Rust: ikalogic_at1000::DutConfiguration

pub struct DutConfiguration {
pub enabled: Option<bool>,
pub target_voltage: Option<f64>,
}

UsbStateโ€‹

{
enabled: boolean,
voltage: number, // Measured voltage
current: number // Measured current in amperes
}

Python: ikalogic_at1000.PowerUsbState, with the same fields.

Rust: ikalogic_at1000::UsbState

pub struct UsbState {
pub enabled: bool,
pub current: f64,
pub voltage: f64,
}

UsbConfigurationโ€‹

{
enabled: boolean
}

Python: ikalogic_at1000.PowerUsbConfiguration, with the same field. configure() builds it from its keyword argument.

Rust: ikalogic_at1000::UsbConfiguration

pub struct UsbConfiguration {
pub enabled: bool,
}

RelayStateโ€‹

{
current: number // Measured current in amperes
}

Python: ikalogic_at1000.RelayPowerState, with the same field.

Rust: ikalogic_at1000::RelayPowerState

pub struct RelayPowerState {
pub current: f64,
}

Notesโ€‹

  • DUT channel supplies 1.6โ€“13 V programmable, or a fixed 24 V at up to 2A
  • USB ports provide standard 5V USB power with monitoring
  • Voltage measurements are highly accurate for precise verification
  • Current measurements allow for real-time monitoring and over-current detection
  • Always allow time for voltage stabilization after enable (100-200ms recommended)
  • disable() and reset() switch an output off but do not discharge it. Poll read_voltage() until the output has decayed before disconnecting a device or enabling the output again
  • Relay 0 provides high-precision current measurement (1ยตA resolution, max 500mA) when closed
  • Monitor current during boot/startup to verify proper device initialization