Sequence¶
- class openlabctrl.sequence.IoSequence(device_list)[source]¶
Bases:
objectMulti-device IO sequence.
An
IoSequencecoordinates 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 andstart()begins execution.- Parameters:
device_list – List of device instances involved in this IO Sequence.
- add_frame(frame, device, label=None)[source]¶
Assign a frame to a device in the sequence.
- Parameters:
frame –
IoSyncFrameorParamIoSyncFrameto 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:
- 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().
- 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.