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. IfNone
, 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__()
.
- 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:
- clock_limit = 8300000.0
- clock_resolution = 2.6666666666666667e-08
- core_clock_freq = 75
- description = 'PB-DDSII-300'
Brief description of the device.
- property direct_outputs
- 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.
- 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
- wait_delay = 1e-07
- 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 theparent_device
andconnection
for instantiating theDigitalOut
. All other (optional) keys are passed as kwargs.freq_limits (tuple, optional) –
(lower, upper)
limits for the frequency of the outputfreq_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 outputamp_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 outputphase_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.
- 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:
- 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
- labscript_device_class_name = 'PulseBlaster'
- num_dds = 2
- num_flags = 12
- class labscript_devices.PulseBlaster.PulseBlasterTab(notebook, settings, restart=False)[source]
Bases:
DeviceTab
- labscript_device_class_name = 'PulseBlaster'
- reset(*args, **kwargs)
- start(*args, **kwargs)
- start_run(*args, **kwargs)
- status_monitor(*args, **kwargs)
- stop(*args, **kwargs)