SHF Scope Module

class zhinst.toolkit.control.drivers.base.SHFScope(parent: zhinst.toolkit.control.drivers.base.base.BaseInstrument)

Implements a Scope representation.

The SHFScope class implements basic functionality of the SHF Scope.

For example, the scope can be configured like this to record the signal at channel 1:

>>> scope = shf.scope
>>> scope.channels(["on", "off", "off", "off"])
>>> scope.input_select(["chan0sigin", "chan1sigin", "chan2sigin", "chan3sigin"])
>>> scope.segments(enable = False, count=1)
>>> scope.averaging(enable = False, count=1)
>>> scope.length(12512)
>>> scope.time(0)

To start recording and obtain the result:

>>> scope.run()
>>> result = scope.read(0)
averaging(enable=None, count=None)

Configure averaging options of Scope measurements.

Keyword Arguments
  • enable (bool) – a flag that specifies whether averaging of Scope measurements is enabled (default: None).

  • count (int) – number of Scope measurements to average (default: None)

Returns

A dictionary showing the enable state and averaging count

channels(value=None)

Set all Scope channels simultaneously.

Parameters

value (tuple) – Tuple of values {‘on’, ‘off’} for channel 1, 2, 3 and 4 (default: None).

Returns

A tuple with the states {‘on’, ‘off’} for all input channels.

input_select(value=None)

Set all Scope input signals simultaneously.

Keyword Arguments

value (tuple) – Tuple of values for input signal 1, 2, 3 and 4. The accepted values can be found in SHFQA user manual (default: None).

Returns

A tuple with the selected input signal sources for all input channels.

read(channel=None, blocking: bool = True, timeout: float = 10, sleep_time: float = 0.005)

Read out the recorded data from the specified channel of the scope.

Parameters
  • channel (int) – The scope channel to read the data from. If no channel is specified, the method will return the data for all channels.

  • blocking (bool) – A flag that specifies if the program should be blocked until the scope has finished recording (default: True).

  • timeout (float) – The maximum waiting time in seconds for the Scope (default: 10).

  • sleep_time (float) – Time in seconds to wait between requesting the progress and records values

Returns

A dictionary showing the recorded data and scope time.

Raises

TimeoutError – if the scope recording is not completed before timeout.

run(sync=True) → None

Run the scope recording.

Parameters

sync (bool) – A flag that specifies if a synchronisation should be performed between the device and the data server after starting the scope recording (default: True).

segments(enable=None, count=None)

Configure segmented Scope recording options.

Keyword Arguments
  • enable (bool) – a flag that specifies whether segmented Scope recording is enabled (default: None).

  • count (int) – number of segments in device memory (default: None)

Returns

A dictionary showing the enable state and segment count

stop(sync=True) → None

Stop the scope recording.

Parameters

sync (bool) – A flag that specifies if a synchronisation should be performed between the device and the data server after stopping scope recording (default: True).

wait_done(timeout: float = 10, sleep_time: float = 0.005) → None

Wait until the Scope recording is finished.

Parameters
  • timeout (int) – The maximum waiting time in seconds for the Scope (default: 10).

  • sleep_time (float) – Time in seconds to wait between requesting the progress and records values

Raises

ToolkitError – If the Scope recording is not done before the timeout.