Skip to content

Source Measure Unit

Auto-generated from driver source.


NI PXIe-4139

NI PXIe-4139 single-channel source measure unit (uses nidcpower).

NI_PXIe_4139

Driver for the NI PXIe-4139 SMU via nidcpower.

Exposes the same PSU-like interface that the REPL expects so it can be used interchangeably with SCPI-based power supplies.

Key nidcpower pattern: property changes (voltage_level, output_enabled) must be applied while the session is initiated (running). Set properties on-the-fly FIRST, then abort() to stop.

connect

connect()

Open an nidcpower session and configure safe defaults.

The session is left in the Running state with output disabled. All subsequent property changes (voltage_level, output_enabled, etc.) are applied via commit() while running — NI-DCPower requires this. If the device is in OLP (Overload Protection), the session is opened with relaxed options to clear the latched state first.

disconnect

disconnect()

Close the nidcpower session.

enable_output

enable_output(enabled: bool = True)

Enable or disable the output. Session stays Running.

disable_all_channels

disable_all_channels()

Set output to safe state: 0 V, low current limit, output off.

set_voltage

set_voltage(voltage: float)

Set the DC voltage level.

set_current_limit

set_current_limit(current: float)

Set the current limit (compliance magnitude, always positive).

set_output_channel

set_output_channel(channel, voltage, current_limit=None)

Set voltage and current limit (channel arg ignored — single channel).

measure_vi

measure_vi() -> dict

Atomic V+I+compliance measurement in a single session call.

Returns:

Type Description
dict

dict with keys 'voltage' (float), 'current' (float),

dict

'in_compliance' (bool).

measure_voltage

measure_voltage() -> float

Measure the output voltage.

measure_current

measure_current() -> float

Measure the output current.

query_in_compliance

query_in_compliance() -> bool

Return True if the output has hit the compliance limit.

set_source_delay

set_source_delay(seconds: float) -> None

Set the source settle delay before measurement (0 to 167 seconds).

get_source_delay

get_source_delay() -> float

Return the current source_delay in seconds.

set_voltage_mode

set_voltage_mode(voltage: float, current_limit: float = None) -> None

Switch to DC_VOLTAGE mode and set the voltage level.

set_current_mode

set_current_mode(current: float, voltage_limit: float = None) -> None

Switch to DC_CURRENT mode and set the current level.

get_output_mode

get_output_mode() -> str

Return the active output mode: 'voltage' or 'current'.

set_samples_to_average

set_samples_to_average(n: int) -> None

Set the averaging count for noise reduction (n >= 1).

get_samples_to_average

get_samples_to_average() -> int

Return the current samples_to_average setting.

read_temperature

read_temperature() -> float

Read the SMU instrument temperature in degrees Celsius.

get_voltage_setpoint

get_voltage_setpoint() -> float

Return the configured voltage level.

get_current_limit

get_current_limit() -> float

Return the configured current limit.

get_output_state

get_output_state() -> bool

Return whether the output is enabled.

reset

reset()

Reset the instrument — full session teardown and reconnect.

This recovers from hard errors like OLP (Overload Protection) where the session is unresponsive to normal commands.

query

query(cmd, **kwargs)

Return an IDN-like string (SCPI compatibility stub).

send_command

send_command(cmd)

No-op SCPI compatibility stub.

get_error

get_error() -> str

SCPI compatibility stub — error queue not supported on NI_PXIe_4139.