Hi,
I would like to execute a branch once.
The rough setup is a SweepMe operated evaporation. At certain points I would like to do measurements and trigger them manually - say at certain thicknesses.
I was thinking of using a button from the control widget to enter the measurement branch and catch the button state using a condition. Then run the measurement if the button is toggled on. The problem that I face is that I have to toggle the button to enter the branch and manually toggle it back so the measurement only happens once. Can I automatically toggle the button back after the measurement is done or is there a better way to achieve this?
Hi,
thanks a lot for adding this question here.
I think using the buttons that are coming with the add-on module ControlWidgets are already the way to go. However, besides the toggle button there is also the trigger button that can be connected with an action such as skip current branch.
So, my suggestion would be to add a trigger button with the text “Skip branch” or “Take a measurement” and connect it with the signal “skip_current_branch”.
If you add the ControlWidgets module only to the first branch, you can only skip when the evaporation is running, but it will not be possible to skip the measurement for the user.
Could you try this and feedback whether it works for you?
Thanks and best,
Axel
Hey,
thanks for the input. This actually worked fine. For some reason I had to add a delay as well for the measurement to run, otherwise it seemed to skip the measurement branch as well…
And I had to put a nonstop loop higher up in the hirarchy for it to continue the evaporation after the measurement but this was rather straight forward.
Thanks again!
Hi,
thanks a lot for the feedback and good to know it works.
The use of Delay should actually not be needed and if you like you can share further information so that we can check what is going on.
The Trigger button has two modes, synchronous and asynchronous operation. The asynchronous mode is needed to trigger events like run or stop a measurement that are not synchronous with the measurement. If you use synchronous mode, the selected action will be performed at the next possible moment as part of the measurement sequence run. This is why I suggest to use synchronous mode in your case.
Still, I cannot explain why also the measurement run was skipped. I will try to reproduce with a minimal example and post it later here.
Thanks and best,
Axel
I created the following minimal example that works for me:
Loop2 creates the general repetition of the two branches. Loop1 is running nonstop in the first branch. The Delay here is just used to have a point each second. The ControlWidgets module that is only part of the first branch comes with trigger button that uses the action “skip_current_branch” in synchronous execution mode.
Once I click the trigger button, the second branch with Loop3 performs 10 iterations and afterwards SweepMe! goes back to the first branch staying again in the nonstop iteration of Loop1 until one presses again the trigger button.
Hope this helps to adapt it to your measurement.
Thanks and best
Axel
This is my sequencer:
and this my button:
If I have the delay unchecked, the SMU does not do the measurement…
The delay also seems not to delay by a second, the SMU seems to start immediately after I clicked the button.
I have to say I’m currently still on 1.5.6 on this PC, not sure if you patched anything on 1.5.7?
It is always good to update to 1.5.7 or the latest version but it should also work in 1.5.6 as there was no change to ControlWidgets.
Could you please move the ControlWidgets module to the end of the first branch and try again. I can reproduce your issue if the ControlWidgets module is not at the end (leaf) of the branch. We need to investigate this further, but putting the ControlWidgets to end of the branch at least worked in my above example.
I will create a backlog item and report when we fixed the problem.
Thanks for reporting!
Best, Axel
Quick update:
If you use the action “skip_sweeps_below” instead of “skip_current_branch” it works. You only need to make sure that the ControlWidgets module is only in the first branch and positioned above all modules that make a sweep, e.g. above your Loop1.
Please use this solution and then the additional branch with Delay should not be needed anymore.
Thanks and best, Axel