labscript.core.TriggerableDevice

class TriggerableDevice(name, parent_device, connection, parentless=False, **kwargs)[source]

Bases: Device

A triggerable version of Device.

This class is for devices that do not require a pseudoclock, but do require a trigger. This enables them to have a Trigger device as a parent.

__init__(name, parent_device, connection, parentless=False, **kwargs)[source]

Instantiate a Triggerable Device.

Parameters:
  • name (str) –

  • () (parent_device) –

  • connection (str) –

  • parentless (bool, optional) –

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

Raises:

LabscriptError – If trigger type of this device does not match the trigger type of the parent Trigger.

Methods

__init__(name, parent_device, connection[, ...])

Instantiate a Triggerable Device.

add_device(device)

Adds a child device to this device.

do_checks()

Check that all devices sharing a trigger device have triggers when this device has a trigger.

generate_code(hdf5_file)

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

get_all_children()

Get all children devices for this device.

get_all_outputs()

Get all children devices that are outputs.

get_properties([location])

Get all properties in location.

get_property(name[, location])

Method to get a property of this device already set using Device.set_property().

init_device_group(hdf5_file)

Creates the device group in the shot file.

quantise_to_pseudoclock(times)

Quantises times to the resolution of the controlling pseudoclock.

set_properties(properties_dict, property_names)

Add one or a bunch of properties packed into properties_dict

set_property(name, value[, location, overwrite])

Method to set a property for this device.

trigger(t, duration)

Request parent trigger device to produce a trigger.

Attributes

allowed_children

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

description

Brief description of the device.

minimum_recovery_time

Minimum time required before another trigger can occur.

parent_clock_line

Stores the clocking clockline, which may be itself.

pseudoclock_device

Stores the clocking pseudoclock, which may be itself.

t0

The earliest time output can be commanded from this device at the start of the experiment.

trigger_edge_type

Type of trigger.

do_checks()[source]

Check that all devices sharing a trigger device have triggers when this device has a trigger.

Raises:

LabscriptError – If correct triggers do not exist for all devices.

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.

minimum_recovery_time = 0

Minimum time required before another trigger can occur.

Type:

float

trigger(t, duration)[source]

Request parent trigger device to produce a trigger.

Parameters:
  • t (float) – Time, in seconds, to produce a trigger.

  • duration (float) – Duration, in seconds, of the trigger pulse.

trigger_edge_type = 'rising'

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

Type:

str