Multi Device Connection

class zhinst.toolkit.MultiDeviceConnection(**kwargs)

A data server connection shared by multiple devices.

A container for devices that ensures a single instrument connection (Data Server) is shared between multiple devices. The MultiDeviceConnection holds dictionaries of different device types. The devices are identified by the name they are given. The MultiDeviceConnection connects to a Data Server with mdc.setup()

>>> import zhinst.toolkit as tk
>>> mdc = tk.MultiDeviceConnection(host="localhost")
>>> mdc.setup()
Successfully connected to data server at localhost8004 api version: 6

and individual devices are added with mdc.connect_device().

>>> mdc.connect_device(tk.HDAWG("hdawg 1", "dev1234"))
>>> mdc.connect_device(tk.HDAWG("hdawg 2", "dev5678"))
>>> mdc.connect_device(tk.UHFQA("uhfqa 1", "dev9999"))
Successfully connected to device DEV1234 on interface 1GBE
Successfully connected to device DEV5678 on interface 1GBE
Successfully connected to device DEV9999 on interface 1GBE

The MultiDeviceConnection holds dictionaries for every device type with the device name as keys:

>>> hdawg1 = mdc.hdawgs["hdawg 1"]
>>> hdawg2 = mdc.hdawgs["hdawg 2"]
>>> uhfqa = mdc.uhfqas["uhfqa 1"]
>>> ...
Keyword Arguments
  • host (str) – the host of the data server (default: ‘localhost’)

  • port (int) – the port for the data server (default: 8004)

  • api (int) – the API level for the data server (default: 6)

hdawgs

A dictionary of HDAWG s with the device names as keys.

Type

dict

uhfqas

A dictionary of UHFQA s with the device names as keys.

Type

dict

uhflis

A dictionary of UHFLI s with the device names as keys.

Type

dict

mflis

A dictionary of MFLI s with the device names as keys.

Type

dict

pqsc

A PQSC if one is added, otherwise None

Type

PQSC

Raises

ToolkitError – if an unknown device is added

connect_device(device: zhinst.toolkit.control.drivers.base.base.BaseInstrument) → None

Connects a device to the MultiDeviceConnection.

Adds a device to the MultiDeviceConnection and connects the device to the shared Data Server. Depending on the device type, the device is added to respective dictionary and can then be accessed from there.

Parameters

device (BaseInstrument) – the device to be added to the MultiDeviceConnection, has to be one of HDAWG, UHFQA, UHFLI, MFLI, PQSC

Raises

ToolkitError – if the device is not recognized