qmi.core.context_singleton.make_instrument

qmi.core.context_singleton.make_instrument(instrument_name: str, instrument_class: type[QMI_Instrument], *args: Any, **kwargs: Any) Any

Create an instance of a QMI_Instrument subclass and make it accessible via RPC.

The actual instrument instance will be created in a separate background thread. To access the instrument, you can call its methods via RPC.

Parameters:
  • instrument_name – A unique name for the new instrument instance. This name will also be used to access the instrument via RPC.

  • instrument_class – Class that implements this instrument (must be a subclass of QMI_Instrument).

  • args – Optional arguments for the instrument class constructor.

  • kwargs – Optional keyword arguments for the instrument class constructor.

Returns:

An RPC proxy that provides access to the new instrument instance.

Raises:

QMI_NoActiveContextException – If there is no active QMI context present.