Light Crafter DMD

This device allows for control of Light Crafter development module boards. It is currently hard-coded to work with a DLPC300 with a fixed DLP 0.3 WVGA resolution. Extenstion to other models involves subclassing and altering relevant class attributes.

Detailed Documentation

labscript_devices.LightCrafterDMD.arr_to_bmp(arr)[source]

Convert array to 1 bit BMP, white wherever the array is nonzero, and return a bytestring of the BMP data

class labscript_devices.LightCrafterDMD.ImageSet(name, parent_device, connection='Mirror')[source]

Bases: labscript.labscript.Output

description = 'A set of images to be displayed on an SLM or DMD'
width = 608
height = 684
default_value

A black image.

Raw bitmap data hidden from docs.

Type

bytes

set_array(t, arr)[source]
set_image(t, path=None, raw=None)[source]

set an image at the given time, either by a filepath to a bmp file, or by a bytestring of bmp data

expand_timeseries(all_times)[source]

We have to override the usual expand_timeseries, as it sees strings as iterables that need flattening! Luckily for us, we should only ever have individual data points, as we won’t be ramping or anything, so this function is a lot simpler than the original, as we have more information about the output.

Not 100% sure that this is enough to cover ramps on other devices sharing the clock, come here if there are issues!

class labscript_devices.LightCrafterDMD.LightCrafterDMD(name, parent_device, server='192.168.1.100', port=21845)[source]

Bases: labscript.labscript.IntermediateDevice

description = 'LightCrafter DMD controller'
allowed_children = [<class 'labscript_devices.LightCrafterDMD.ImageSet'>]
max_instructions = 96
clock_limit = 4000
width = 608
height = 684
add_device(device)[source]
generate_code(hdf5_file)[source]
class labscript_devices.LightCrafterDMD.LightCrafterTab(notebook, settings, restart=False)[source]

Bases: blacs.device_base_class.DeviceTab

width = 608
height = 684
initialise_GUI()[source]
initialise_workers()[source]
labscript_device_class_name = 'LightCrafterDMD'
class labscript_devices.LightCrafterDMD.LightCrafterWorker(*args, **kwargs)[source]

Bases: blacs.tab_base_classes.Worker

command = {'advance_pattern_sequence': b'\x04\x03', 'display_mode': b'\x01\x01', 'display_pattern': b'\x04\x05', 'pattern_definition': b'\x04\x01', 'sequence_setting': b'\x04\x00', 'start_pattern_sequence': b'\x04\x02', 'static_image': b'\x01\x05', 'version': b'\x01\x00'}
send_packet_type = {'read': b'\x04', 'write': b'\x02'}
receive_packet_type = {b'\x00': 'System Busy', b'\x01': 'Error', b'\x03': 'Write response', b'\x05': 'Read response'}
flag = {'beginning': b'\x01', 'complete': b'\x00', 'end': b'\x03', 'intermediate': b'\x02'}
error_messages = {b'\x01': 'Command execution failed with unknown error', b'\x02': 'Invalid command', b'\x03': 'Invalid parameter', b'\x04': 'Out of memory resource', b'\x05': 'Hardware device failure', b'\x06': 'Hardware busy', b'\x07': 'Not Initialized (any of the preconditions for the command is not met', b'\x08': 'Some object referred by the command is not found. For example, a solution name was not found', b'\t': 'Checksum error', b'\n': 'Packet format error due to insufficient or larger than expected payload size', b'\x0b': 'Command continuation error due to incorrect continuation flag'}
display_mode = {'pattern': b'\x04', 'static': b'\x00'}
init()[source]
send(type, command, data)[source]
_receive()[source]
receive()[source]
program_manual(values)[source]
transition_to_buffered(device_name, h5file, initial_values, fresh)[source]
transition_to_manual()[source]
abort()[source]
abort_buffered()[source]
abort_transition_to_buffered()[source]
shutdown()[source]