Session#

class Session(*args: Any, **kwargs: Any)[source]#

Bases: ZIInstrument

Session to a data server.

Zurich Instruments devices use a server-based connectivity methodology. Server-based means that all communication between the user and the instrument takes place via a computer program called a server, the data sever. The data sever recognizes available instruments and manages all communication between the instrument and the host computer on one side, and communication to all the connected clients on the other side. (For more information on the architecture please refer to the user manual http://docs.zhinst.com/labone_programming_manual/introduction.html)

The entry point into for any connection is therefor a client session to a existing data sever. This class represents a single client session to a data server. The session enables the user to connect to one or multiple instruments (also creates the dedicated objects for each device), access the LabOne modules and poll data. In short it is the only object the user need to create by himself.

Info:

Except for the HF2 a single session can be used to connect to all devices from Zurich Instruments. Since the HF2 is historically based on another data server called the hf2 data server it is not possible to connect HF2 devices a “normal” data server and also not possible to connect devices apart from HF2 to the hf2 data server.

Parameters:
  • server_host – Host address of the data server (e.g. localhost)

  • server_port – Port number of the data server. If not specified the session uses the default port 8004 (8005 for HF2 if specified). (default = None)

  • hf2 – Flag if the session should be established with an HF2 data sever or the “normal” one for all other devices. If not specified the session will detect the type of the data server based on the port. (default = None)

  • connection – Existing daq server object. If specified the session will not create a new session to the data server but reuse the passed one. (default = None)

  • args (Any)

  • kwargs (Any)

Return type:

Any

Methods

connect_device(serial, *[, interface, name, raw])

Establish a connection to a device.

disconnect_device(serial)

Disconnect a device.

poll([recording_time, timeout, flags])

Polls all subscribed data.

sync()

Synchronize all connected devices.

Attributes

daq_server

Managed instance of the zi.ziDAQServer.

is_hf2_server

Flag if the data server is a HF2 Data Server.

server_host

Server host.

server_port

Server port.

toolkit_session

Underlying zhinst-toolkit session.