Rudimentary logic branching

33 views
Skip to first unread message

Ryan McGill

unread,
Apr 24, 2026, 12:54:58 PMApr 24
to the labscript suite
Hello!

I am looking to see if anyone has done any simple logic branching in the labscript environment. A quick look through the past conversations has shown whispers, so curious if anyone has implemented anything. 

My experiment requires a simple feedback loop - I am making a voltage measurement, and I wish to make a decision based on the previously read voltage (in this case, trigger a TTL low or high based on the voltage threshold). This does not have to be fast - I would naturally want it to happen in between shots, or update a global in runmanager to queue up the decision. Is something like this possible / been done before? 

Thanks! 
Ryan

Ryan McGill

unread,
May 6, 2026, 4:19:32 PM (3 days ago) May 6
to the labscript suite
I have resolved this issue. Perhaps it is not in true pure Labscript etiquette to feedback directly to globals, but following my Lyse analysis, I simply call runmanager.remote.get_globals() and set_globals() to perform my feedback. Essentially, my experiment does:
  1. Execute experiment shot
  2. Lyse analysis on created h5 data
  3. runmanager.remote.get_globals(), update given dictionary, and  runmanager.remote.set_globals() only on the single dictionary (or any other item you would like to feedback to). 

Ian B. Spielman

unread,
May 7, 2026, 11:42:30 AM (2 days ago) May 7
to labscri...@googlegroups.com
Hi Ryan,

I didn’t initially understand your question: I thought you wanted in-shot conditional updates. We have been doing “update the next shot” with differing degrees of “hack” for many years. The main issue with stock labscript is that the blacs queue contains compiled shots. In https://arxiv.org/abs/2603.06988 we use a hack where blacs adds an offset to specific arrays after pulling them from the h5 file, but before sending them to the device. In past years I made a hack to blacs that had it recompile the whole shot based on new runmanager variables just before submitting.

To solve this problem “for real” we are locally testing aversion of runmanager that has its own queue (and a number of other improvements) that has an option to not compile shots until blacs actually asks for them (attached). This is a fairly large change so I am “dripping” in bite-sized pull requests to the labscript/zprocess githubs for this an another labscript related project.

PastedGraphic-1.png

Ryan McGill

unread,
May 7, 2026, 4:58:52 PM (2 days ago) May 7
to the labscript suite
Ian, 

This is fantastic - I investigated doing something on the fly at first as a hacky way (such as, trying to dip into the h5 during transition_to_buffered) but ostensibly my experiment is super simple and didn't need shot-time decisions, especially when I found the runmanager.remote library functionality. 

For future experiments we certainly are interested in doing something similar to what you discussed and in your screenshot. Still new to the labscript environment, but will be tracking the labscript/zprocess repos for updates!
Reply all
Reply to author
Forward
0 new messages