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โ
- NodeJS
- Python
- Rust
const power = tester.power;
power = tester.power
let 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().
- NodeJS
- Python
- Rust
await tester.power.reset();
tester.power.reset()
tester.power.reset()?;
Returns: Promise<void> / None / Result<(), At1000Error>
dut(id)โ
Access a specific DUT power supply channel.
- NodeJS
- Python
- Rust
const dut0 = tester.power.dut(0);
dut0 = tester.power.dut(0)
let 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.
- NodeJS
- Python
- Rust
const usb0 = tester.power.usb(0);
usb0 = tester.power.usb(0)
let 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.
- NodeJS
- Python
- Rust
const relay0 = tester.power.relay_0();
relay0 = tester.power.relay_0()
let 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().
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.
- NodeJS
- Python
- Rust
await dut.reset();
dut.reset()
let dut = tester.power.dut(0)?;
dut.reset()?;
Returns: Promise<void> / None / Result<(), At1000Error>
configure(config)โ
Configures the DUT power supply.
- NodeJS
- Python
- Rust
await dut.configure({
enabled: true,
target_voltage: 3.3
});
dut.configure(enabled=True, target_voltage=3.3)
use ikalogic_at1000::DutConfiguration;
let dut = tester.power.dut(0)?;
dut.configure(DutConfiguration {
enabled: Some(true),
target_voltage: Some(3.3),
})?;
Parameters:
config(DutConfiguration; in Python, keyword arguments):enabled(boolean/bool/Option<bool>, optional): Enable or disable the supplytarget_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) iftarget_voltageis 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 setsenabledtofalse, and a rejected call changes nothing- JavaScript throws a validation error before sending if
target_voltageis outside ยฑ25 V. Rust returnsInvalidInputbefore sending iftarget_voltageis outside 1.6โ13 V and is not exactly24.0, including whenenabledisSome(false)
enable(voltage)โ
Enables the DUT power supply at the specified voltage.
- NodeJS
- Python
- Rust
await dut.enable(12.0); // Enable at 12V
dut.enable(12.0) # Enable at 12V
let dut = tester.power.dut(0)?;
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) ifvoltageis 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
voltageis outside ยฑ25 V. Rust returnsInvalidInputbefore sending ifvoltageis outside 1.6โ13 V and is not exactly24.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
InvalidInputbefore sending ifvoltageis outside 1.6โ13 V and is not exactly24.0
disable()โ
Switches the DUT power supply off. The target voltage is kept.
- NodeJS
- Python
- Rust
await dut.disable();
dut.disable()
let dut = tester.power.dut(0)?;
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
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().
- NodeJS
- Python
- Rust
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");
state = dut.read()
print(f"Enabled: {state.enabled}")
print(f"Target: {state.target_voltage} V")
print(f"Actual: {state.voltage} V")
print(f"Current: {state.current} A")
let dut = tester.power.dut(0)?;
let state = dut.read()?;
println!("Enabled: {}", state.enabled);
println!("Target: {} V", state.target_voltage);
println!("Actual: {} V", state.voltage);
println!("Current: {} A", state.current);
Returns: Promise<DutState> / PowerDutState / Result<DutState, At1000Error> - Full state object
read_current()โ
Reads only the current drawn by the DUT.
- NodeJS
- Python
- Rust
const current = await dut.read_current();
console.log("Current:", current, "A");
current = dut.read_current()
print(f"Current: {current} A")
let dut = tester.power.dut(0)?;
let current = dut.read_current()?;
println!("Current: {current} A");
Returns: Promise<number> / float / Result<f64, At1000Error> - Current in amperes
read_voltage()โ
Reads only the actual output voltage.
- NodeJS
- Python
- Rust
const voltage = await dut.read_voltage();
console.log("Voltage:", voltage, "V");
voltage = dut.read_voltage()
print(f"Voltage: {voltage} V")
let dut = tester.power.dut(0)?;
let voltage = dut.read_voltage()?;
println!("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.
- NodeJS
- Python
- Rust
await usb.reset();
usb.reset()
let usb = tester.power.usb(0)?;
usb.reset()?;
Returns: Promise<void> / None / Result<(), At1000Error>
configure(config)โ
Configures the USB port power.
- NodeJS
- Python
- Rust
await usb.configure({
enabled: true
});
usb.configure(enabled=True)
use ikalogic_at1000::UsbConfiguration;
let usb = tester.power.usb(0)?;
usb.configure(UsbConfiguration { enabled: true })?;
Parameters:
config(UsbConfiguration; in Python, the keyword argumentenabled):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.
- NodeJS
- Python
- Rust
await usb.enable();
usb.enable()
let usb = tester.power.usb(0)?;
usb.enable()?;
Returns: Promise<UsbState> / PowerUsbState / Result<UsbState, At1000Error> - State with enabled: true, measured right after the change
disable()โ
Switches USB port power off.
- NodeJS
- Python
- Rust
await usb.disable();
usb.disable()
let usb = tester.power.usb(0)?;
usb.disable()?;
Returns: Promise<UsbState> / PowerUsbState / Result<UsbState, At1000Error> - State with enabled: false, measured right after the change, before the port voltage has decayed
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.
- NodeJS
- Python
- Rust
const state = await usb.read();
console.log("Enabled:", state.enabled);
console.log("Voltage:", state.voltage, "V");
console.log("Current:", state.current, "A");
state = usb.read()
print(f"Enabled: {state.enabled}")
print(f"Voltage: {state.voltage} V")
print(f"Current: {state.current} A")
let usb = tester.power.usb(0)?;
let state = usb.read()?;
println!("Enabled: {}", state.enabled);
println!("Voltage: {} V", state.voltage);
println!("Current: {} A", state.current);
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.
- NodeJS
- Python
- Rust
const current = await usb.read_current();
console.log("USB Current:", current, "A");
current = usb.read_current()
print(f"USB Current: {current} A")
let usb = tester.power.usb(0)?;
let current = usb.read_current()?;
println!("USB Current: {current} A");
Returns: Promise<number> / float / Result<f64, At1000Error> - Current in amperes
read_voltage()โ
Reads the USB port voltage.
- NodeJS
- Python
- Rust
const voltage = await usb.read_voltage();
console.log("USB Voltage:", voltage, "V");
voltage = usb.read_voltage()
print(f"USB Voltage: {voltage} V")
let usb = tester.power.usb(0)?;
let voltage = usb.read_voltage()?;
println!("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.
- NodeJS
- Python
- Rust
const state = await relay0.read();
console.log("Current through relay:", state.current, "A");
state = relay0.read()
print(f"Current through relay: {state.current} A")
let relay0 = tester.power.relay_0();
let state = relay0.read()?;
println!("Current through relay: {} A", state.current);
Returns: Promise<RelayState> / RelayPowerState / Result<RelayPowerState, At1000Error> - State object with current measurement
read_current()โ
Reads only the current flowing through the relay.
- NodeJS
- Python
- Rust
const current = await relay0.read_current();
console.log("Relay 0 Current:", current, "A");
current = relay0.read_current()
print(f"Relay 0 Current: {current} A")
let relay0 = tester.power.relay_0();
let current = relay0.read_current()?;
println!("Relay 0 Current: {current} A");
Returns: Promise<number> / float / Result<f64, At1000Error> - Current in amperes
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()andreset()switch an output off but do not discharge it. Pollread_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