Pulseblaster

This labscript device controls the Spincore PulseblaserDDS-II-300-AWG. The Pulseblaster is a programmable pulse generator that is the typical timing backbone of an experiment (ie it generates the pseudoclock timing pulses that control execution of other devices in the experiment). This labscript device is the master implementation of the various Pulseblaster devices. Other Pulseblaster labscript devices subclass this device and make the relevant changes to hard-coded values. Most importantly, the core_clock_freq must be manually set to match that of the Pulseblaster being used in order for the timing of the programmed pulses to be correct (in the labscript_device and the BLACS_worker).

This particular version of Pulseblaster has a 75 MHz core clock frequency and also has DDS synthesizer outputs.

Installation

Use of the Pulseblaster requires driver installation available from the manufacturer here. The corresponding python wrapper, spinapi is available via pip.

pip install -U spinapi

Usage

from labscript import *

from labscript_devices.PulseBlaster import PulseBlaster

PulseBlaster(name='pb',board_number=0,programming_scheme='pb_start/BRANCH')

Clockline(name='pb_clockline_fast', pseudoclock=pb.pseudoclock,connection='flag 0')
Clockline(name='pb_clockline_slow', pseudoclock=pb.pseudoclock,connection='flag 1')

DigitalOut(name='pb_0',parent_device=pb.direct_outputs,connection='flag 2')

PulseBlasterDDS(name='pb_dds_0',parent_device=pb.direct_outputs, 'channel 0')

start()

stop(1)

Detailed Documentation

class labscript_devices.PulseBlaster.PulseBlaster(name, trigger_device=None, trigger_connection=None, board_number=0, firmware='', programming_scheme='pb_start/BRANCH', pulse_width='symmetric', max_instructions=4000, time_based_stop_workaround=False, time_based_stop_workaround_extra_time=0.5, **kwargs)[source]

Bases: PseudoclockDevice

Instantiates a pseudoclock device.

Parameters:
  • name (str) – python variable to assign to this device.

  • trigger_device (DigitalOut) – Sets the parent triggering output. If None, this is considered the master pseudoclock.

  • trigger_connection (str, optional) – Must be provided if trigger_device is provided. Specifies the channel of the parent device.

  • **kwargs – Passed to TriggerableDevice.__init__().

_check_wait_monitor_ok()[source]
add_device(device)[source]

Adds a child device to this device.

Parameters:

device (Device) – Device to add.

Raises:

LabscriptError – If device is not an allowed child of this device.

allowed_children = [<class 'labscript.labscript.Pseudoclock'>]

Defines types of devices that are allowed to be children of this device.

Type:

list

clock_limit = 8300000.0
clock_resolution = 2.6666666666666667e-08
convert_to_pb_inst(dig_outputs, dds_outputs, freqs, amps, phases)[source]
core_clock_freq = 75
description = 'PB-DDSII-300'

Brief description of the device.

property direct_outputs
flag_is_clock(flag)[source]
flag_valid(flag)[source]
generate_code(hdf5_file)[source]

Generate hardware instructions for device and children, then save to h5 file.

Will recursively call generate_code for all children devices.

Parameters:

hdf5_file (h5py.File) – Handle to shot file.

generate_registers(hdf5_file, dds_outputs)[source]
get_direct_outputs()[source]

Finds out which outputs are directly attached to the PulseBlaster

get_flag_number(connection)[source]
n_flags = 12
pb_instructions = {'BRANCH': 6, 'CONTINUE': 0, 'END_LOOP': 3, 'LONG_DELAY': 7, 'LOOP': 2, 'STOP': 1, 'WAIT': 8}
property pseudoclock
trigger_delay = 2.5e-07
trigger_edge_type = 'falling'

Type of trigger. Must be 'rising' or 'falling'.

Type:

str

wait_delay = 1e-07
write_pb_inst_to_h5(pb_inst, hdf5_file)[source]
class labscript_devices.PulseBlaster.PulseBlasterDDS(*args, **kwargs)[source]

Bases: DDSQuantity

Instantiates a DDS quantity.

Parameters:
  • name (str) – python variable for the object created.

  • parent_device (IntermediateDevice) – Device this output is connected to.

  • connection (str) – Output of parent device this DDS is connected to.

  • digital_gate (dict, optional) – Configures a digital output to use as an enable/disable gate for the output. Should contain keys 'device' and 'connection' with arguments for the parent_device and connection for instantiating the DigitalOut. All other (optional) keys are passed as kwargs.

  • freq_limits (tuple, optional) – (lower, upper) limits for the frequency of the output

  • freq_conv_class (labscript_utils:labscript_utils.unitconversions, optional) – Unit conversion class for the frequency of the output.

  • freq_conv_params (dict, optional) – Keyword arguments passed to the unit conversion class for the frequency of the output.

  • amp_limits (tuple, optional) – (lower, upper) limits for the amplitude of the output

  • amp_conv_class (labscript_utils:labscript_utils.unitconversions, optional) – Unit conversion class for the amplitude of the output.

  • amp_conv_params (dict, optional) – Keyword arguments passed to the unit conversion class for the amplitude of the output.

  • phase_limits (tuple, optional) – (lower, upper) limits for the phase of the output

  • phase_conv_class (labscript_utils:labscript_utils.unitconversions, optional) – Unit conversion class for the phase of the output.

  • phase_conv_params (dict, optional) – Keyword arguments passed to the unit conversion class for the phase of the output.

  • call_parents_add_device (bool, optional) – Have the parent device run its add_device method.

  • **kwargs – Keyword arguments passed to Device.__init__().

description = 'PulseBlasterDDS'

Brief description of the device.

hold_phase(t)[source]
release_phase(t)[source]
class labscript_devices.PulseBlaster.PulseBlasterDirectOutputs(name, parent_device, **kwargs)[source]

Bases: IntermediateDevice

Provides some error checking to ensure parent_device is a ClockLine.

Calls Device.__init__().

Parameters:
  • name (str) – python variable name to assign to device

  • parent_device (ClockLine) – Parent ClockLine device.

add_device(device)[source]

Adds a child device to this device.

Parameters:

device (Device) – Device to add.

Raises:

LabscriptError – If device is not an allowed child of this device.

allowed_children = [<class 'labscript.labscript.DDS'>, <class 'labscript_devices.PulseBlaster.PulseBlasterDDS'>, <class 'labscript.labscript.DigitalOut'>]

Defines types of devices that are allowed to be children of this device.

Type:

list

clock_limit = 8300000.0
description = 'PB-DDSII-300 Direct Outputs'

Brief description of the device.

class labscript_devices.PulseBlaster.PulseBlasterParser(path, device)[source]

Bases: object

_add_pulse_program_row_from_buffer(traces, index)[source]
_add_pulse_program_row_to_traces(traces, row, dds, flags=None)[source]
get_traces(add_trace, parent=None)[source]
labscript_device_class_name = 'PulseBlaster'
num_dds = 2
num_flags = 12
class labscript_devices.PulseBlaster.PulseBlasterTab(notebook, settings, restart=False)[source]

Bases: DeviceTab

get_child_from_connection_table(parent_device_name, port)[source]
initialise_GUI()[source]
labscript_device_class_name = 'PulseBlaster'
reset(*args, **kwargs)
start(*args, **kwargs)
start_run(*args, **kwargs)
status_monitor(*args, **kwargs)
stop(*args, **kwargs)
class labscript_devices.PulseBlaster.PulseblasterWorker(*args, **kwargs)[source]

Bases: Worker

abort_buffered()[source]
abort_transition_to_buffered()[source]
check_status()[source]
init()[source]
program_manual(values)[source]
shutdown()[source]
start_run()[source]
transition_to_buffered(device_name, h5file, initial_values, fresh)[source]
transition_to_manual()[source]
labscript_devices.PulseBlaster.profile(funct)[source]
labscript_devices.PulseBlaster.start_profile(name)[source]
labscript_devices.PulseBlaster.stop_profile(name)[source]