autoDetect#

autoDetect(daq: ziDAQServer, exclude: Optional[List[str]] = None) str[source]#

Return one of the devices connected to the Data Server.

Return a string containing the first device ID (not in the exclude list) that is attached to the Data Server connected via daq, an instance of the ziPython.ziDAQServer class.

Parameters:
  • daq (ziDAQServer) – An instance of the ziPython.ziDAQServer class (representing an API session connected to a Data Server).

  • exclude (Optional[List[str]]) – A list of strings specifying devices to exclude. autoDetect() will not return the name of a device in this list.

Returns:

Device ID of a device connected to the Data Server not in exclude.

Raises:
  • RuntimeError – If no device was found.

  • RuntimeError – If daq is not an instance of ziPython.ziDAQServer.

Return type:

str

Example

>>> zhinst.utils
>>> daq = zhinst.utils.autoConnect()
>>> device = zhinst.utils.autoDetect(daq)