07-22-2026 03:11 AM - edited 07-22-2026 04:08 AM
Hi,
I'm experimenting with executing sequences in parallel. Attached is a screenshot about the main sequence. As you see after an initial popup it calls the cartridge sequence multiple times, each one in a new thread. This subsequence is a dummy, currently it just waits a random amount of seconds and then throws a popup. The point here is to simulate that executing the called subsequences might take different times.
Once the for loop is done, my main sequence continues the execution and immediately throws me a popup that the main sequence is completed.
The thing is that I'd like the main sequence to wait until all the subsequences are completed. To achieve this I guess I need some sort of a rendezvous, but what would be the implementation? (if can be implemented at all on my sequence, witch has no process model at this time and starts the subsequences in new threads)
The sequence file is also attached. I guess I should use the batch model here (or the parallel), but for now I try to keep things easier and not involve a process model, if thats possible.
EDIT: Also its important that this main sequence may lauch different sequences in the for loop. Those will be separate sequence files on the hard drive, not subsequences of the file attached.
Thanks.
1984_0-1784707726729.png
Solved! Go to Solution.
07-22-2026 06:01 AM
You mean spawning multiple sequences in their own thread and wait at the end of the MainSequence? Or after the ForLoop?
07-22-2026 06:33 AM
@Oli_Wachno wrote:
You mean spawning multiple sequences in their own thread and wait at the end of the MainSequence? Or after the ForLoop?
After the for loop. I want the popup in the cleanup to execute only when all the sequence calls in the for loop are completed. And again, at the end the for loop might call different sequence files not just calling the same subsequence.
07-22-2026 08:48 AM - edited 07-22-2026 08:48 AM
You can store a reference to each thread you start in a local variable and create a synchronization point somewhere later in the code with a wait step pointing to this reference. The example is a simple and stupid implementation.
Oli_Wachno_0-1784727944869.png
07-23-2026 01:45 AM
@Oli_Wachno wrote:
You can store a reference to each thread you start in a local variable and create a synchronization point somewhere later in the code with a wait step pointing to this reference. The example is a simple and stupid implementation.
Thanks man, this works. I'm amazed how teststand is capable to hide information from the user. I scratched my head a lot on how the MyThreadRefs array is populated, and it took me a while to figure that in the sequence call step I have to click to the little wrench icon.
(Another solution cound be is to pass the NumberOfLoops variable (by reference) to the subsequences and let them decrement it by one at their last step in the cleanup part. Then we can wait until the NumberOfLoops variable is zero.)
07-23-2026 01:24 PM
Feel free to mark this thread as solved, if yout questions are answered.