Hello Kumar,
The Batch process model shipped with TestStand does not handle this scenario, but you can still do this. Attached is a sequence file that utilizes the Batch Model's ProcessCleanup callback to reset the next execution point. It still uses the method of setting the Parameters.ModelOptions.NumTestSockets variable in the PreBatch callback. The change I added was three steps to a different callback (the ProcessCleanup callback):
Message Popup - prompts Yes or No to continue testing with a new batch size.
Statement 1 - based on the response to the message popup (via precondition), resets the Batch Model's next step to be executed and the ContinueTesting flag:
RunState.Root.RunState.StepGroup = "Setup"
RunState.Root.RunState.NextStepIndex = 0
RunState.Root.Locals.ModelData.ContinueTesting = True
Statement 2 - based on the response to the message popup (via precondition), loops to reset each TestSocket's ContinueTesting flag:
RunState.Root.Locals.ModelData.TestSockets[RunState.LoopIndex].ContinueTesting = True
These two statement steps force the next step to be executed in the Batch Process Model to be the first step in the "Setup" step group, and reset all necessary flags for the batch itself and the individual TestSockets. I discovered the flags that had to be reset by trial-and-error (that was the time-consuming part).
You can run continuous batches of the same size you first chose (for as long as you like), but when stop the batch execution this new message popup will prompt (yes/no) whether you want to continue testing with a new batch size. If no, then processing terminates. If yes, then the next two statement steps are run and execution resumes back at the beginning of the Batch Process Model's Setup step group. This forces the ModelOptions callback to be executed again, so your VI (in my example here it's just a Message Popop) can then set NumTestSockets appropriately.
Thanks for contacting National Instruments!
David Mc.
NI Applications Engineering