What is QMI?


  • Device drivers: With device drivers instruments and devices can be controlled
  • QMI contexts: A QMI context envelops instruments, tasks and other RPC objects and can be connected to from outside from another QMI context
  • Remote Procedure Calls: Custom RPC are used to control objects in QMI contexts
  • QMI signals: QMI context objects can also broadcast and receive signals, which can include e.g. data

'Hello World'


  • A QMI context is created using qmi.start("<context_name>") call
  • Always remember to stop the context with qmi.stop()

Controlling an instrument


  • Instruments can be added into contexts with <instrument_object> = qmi.make_instrument("<name>", <ClassName>, <possible_extra_parameters>)
  • Instrument class description can be seen with help(<instrument_object>)
  • Detailed information about the object and variables can be obtained with dir(<instrument_object>)
  • The returned instrument object is an RPC proxy object of the actual class object

Configuring and logging


  • qmi.conf has a JSON-like structure
  • Log levels are set within “logging” keyword section
  • Default name and location of the log file are qmi.log and the user’s home directory

Accessing an instrument remotely


  • Instruments to be accessed remotely should be defined in `qmi.conf
  • Connect to another QMI context using qmi.context().connect_to_peer("<context_name>", peer_address="<ho.st.i.p:port>")
  • Obtain remote instrument control with qmi.get_instrument("<context_name>.<instrument_name>")

Create a task and a 'service'


  • Instruments to be accessed remotely should be defined in `qmi.conf
  • Connect to another QMI context using qmi.context().connect_to_peer("<context_name>", peer_address="<ho.st.i.p:port>")
  • Obtain remote instrument control with qmi.get_instrument("<context_name>.<instrument_name>")

Open-source vs internal code


  • In Github we have open-source QMI and in Gitlab the internal closed-source QMI
  • Users can make requests via opening new issues a.k.a. tickets in the repository
  • You can and are welcome to contribute too! Just follow the guidelines

Good coding practises: MyPy


  • MyPy is a tool to check typing in code
  • Using typing can reveal coding errors like mis- or double use of same variable leading to exceptions in code execution
  • A good IDE can help to find typing issues
  • Mypy does not check typing for string formatting

Releasing and versioning of QMI code


  • While main version-revision development happens through the main branch, also version-revision-specific development can be done through stable branches
  • User can also use tags as references to code at certain point of time
  • The usual way to install QMI is using Pip and a Pypi package of QMI. But, also releases can be downloaded and used for the installation.