Sequence

class openlabctrl.sequence.IoSequence(device_list)[source]

Bases: object

Multi-device IO sequence.

An IoSequence coordinates a list of devices by assigning frames to each one and optionally inserting synchronization barriers (add_rsync()) between them. Once all frames are added, upload() transfers the instruction lists to the devices and start() begins execution.

Parameters:

device_list – List of device instances involved in this IO Sequence.

reset()[source]

Remove scheduled frames and rsync events.

add_frame(frame, device, label=None)[source]

Assign a frame to a device in the sequence.

Parameters:
  • frameIoSyncFrame or ParamIoSyncFrame to add.

  • device – Target device instance. Must be in the sequence device list and compatible with the frame’s device type.

  • label – Optional label for the frame. Auto-generated if not provided.

add_rsync()[source]

Insert a synchronization barrier across all devices (requires a daisy chain / sync connection between devices). All devices wait at this barrier until the slowest one arrives before proceeding to the next frame.

sequence_description()[source]

Return an ASCII table showing the frame layout across all devices.

Rsync barriers are shown as horizontal lines spanning all columns. Frames triggered by an external source are marked with (*).

Return type:

str

upload()[source]

Upload all frames to their respective devices.

Compiles and transfers the instruction lists for every device in the sequence. Must be called after all frames (and rsync barriers) have been added, and before start().

start()[source]

Start execution of the uploaded sequence on all devices simultaneously.

is_done()[source]

Return True if all devices have finished executing their frames.

Return type:

bool

is_error()[source]

Return True if any device has reported an error.

Return type:

bool

wait()[source]

Block until the sequence has finished executing.

Polls is_done() in a tight loop. Raises an exception if any device reports an error while waiting.

stop()[source]

Stop execution on all devices.

get_status()[source]

Return the execution status of all devices. See LED blink for an example of status messages.

Return type:

dict

get_scope()[source]

Retrieve acquisition data from all devices after the sequence has finished. See RF IO for and example of scope dictionaries and acquired data.

Return type:

dict