blacs: updating hardware instructions before transition_to_buffered

45 views
Skip to first unread message

Edvinas Gvozdiovas

unread,
Sep 9, 2025, 12:21:01 PMSep 9
to the labscript suite
Hello,

I am working on a project where we update hardware instructions just before shots begin running (we use this to stabilize the magnetic field in our experiments). We are going to publish a paper about this in the coming weeks -- I want to work on making this solution more accessible for other groups.

So far, I've landed on a solution that unfortunately requires a small modification to experiment_queue.py. I attached the relevant code - the modification starts at line 580 in transition_to_buffered.

The modification is very simple - before the hardware instructions are read (line 588), I open the .h5 file in write mode, shift all voltage values for a specific analog channel in the .h5 file, save the changes and close the file. Then, blacs operates as usual. We have tested this for many months without any issues.

I am wondering if there is a "kosher" way to do this without modifying the blacs codebase, instead having this as a standalone blacs plugin.
Far as I can tell, the only reason I can't do this with a blacs plugin is because they all run after transition_to_buffered.

I'd like to make this a blacs plugin by doing these modifications to the next anticipated shot in the queue, but the ability for the user to move shots around at will and repeats make the stability of such a solution questionable in my eyes.

Penny for your thoughts.

All the best,
Edvinas
experiment_queue.py
blacs_uwave_lock_v2.py

Johannes Schabbauer

unread,
Sep 12, 2025, 3:30:03 AMSep 12
to the labscript suite
Hey Edvinas,

Want to do might be possible nicely using the "FunctionRunner" device in BLACS, where you could either edit the HDF5 shot file or the globals in runmanager directly before or after the experiment. When you also use the start_order/stop_order arguments, you can make sure the function runs before all other devices transitioning.

Best wishes,
Johannes

Philip Starkey

unread,
Sep 12, 2025, 9:33:55 AMSep 12
to the labscript suite
Hi Edvinas,

It looks like your experiment queue file is missing this plugin callback?
It looks to be exactly in the place you want!

Cheers,
Phil 

Edvinas Gvozdiovas

unread,
Sep 12, 2025, 9:37:06 AMSep 12
to labscri...@googlegroups.com
Oh, that's funny. We are running an older version of labscript so that checks out.

This is very helpful, thank you!

--
You received this message because you are subscribed to the Google Groups "the labscript suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to labscriptsuit...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/labscriptsuite/58e5ad51-9662-4cb4-89f1-a732cae36f85n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages