NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Make Batch Model Test UUTs run once

Solved!
Go to solution

Like the Batch Model Test UUTs dialog window, but only want to see it once.

How should stop the loop?

 

The batch model is for a subsequence, called multiple times by the main sequence in sequential model.

 

 

George Zou
George Zou
0 Kudos
Message 1 of 5
(1,688 Views)
Solution
Accepted by topic author zou

Hi zou,

 

When you say you want to see it "once" do you mean once per call of the subsequence that executes through the batch model or once during the lifetime of the execution?

 

If you mean once during the lifetime of the execution, that gets pretty tricky as you're then wanting calls to the same model to behave differently which requires some level of tracking between batch model executions. You could use a variable to suppress the model dialog but that would cause empty strings to be set for the UUT and batch serial numbers in the report and I would assume you want the information entered on the first instance of the dialog to persist between invocations. At that point, you'd have to handle saving back that serial information and programmatically re-applying it in the PreBatch callback to avoid empty serial info. on subsequent calls of your subsequence.

 

EDIT: I should preface this with you should thoroughly test this if you're going to do it. While it seems to work on my end, model modifications can be pretty difficult to vet to ensure they don't have unintended consequences. If you want to see it once per call of the subsequence, you can modify the batch model by skipping the loop steps and adding a terminate call just after the loop end to simulate the terminate that would typically come from the batch dialog (more detail coming). If you're going to modify the batch model, you should copy the existing batch model from C:\Program Files\National Instruments\TestStand <version>\Components\Models\TestStandModels\BatchModel.seq to the same location in the TestStand public directory (C:\Users\Public\Documents\National Instruments\TestStand <version> (64-bit)\Components\Models - you'll need to create a "TestStand Models" directory there to copy the model sequence to). By placing it under the same directory location in the public directory structure, any model there of the same name as a model in the TestStand main directory structure will essentially override that default TestStand model, so if you don't want all invocations of the batch model to have this modification, I would suggest re-naming the modified model sequence you copy to the public directory. This will allow you to point to either one selectively rather than always selecting the override when you select the batch model.

 

Once you have the model sequence copied into the public directory to ensure you preserve the default model, you can modify the model as follows:

  1. Open the copied model sequence file
  2. in the Sequences pane, select the red "Test UUTs" sequence
  3. There, select both the "For" step at the beginning of the Batch Loop and the corresponding "End" step and right-click and select "Run Mode >> Skip". This will prevent the Batch loop from iterating.DJColeslaw_2-1643322509135.png
  4. Add a statement step just after the skipped end step. This will replace the functionality of the Stop button that would normally send terminate from the second instance of the dialog. There, enter "Runstate.Execution.Terminate()" so the Batch model terminates after the first iteration of the Batch Loop.

 

Once you've made the modifications, you just use the path of the modified model in your subsequence call to execute that subsequence through the modified model.

 

Regards,
Message 2 of 5
(1,594 Views)
Solution
Accepted by topic author zou

Thank you so much for reply.

I solved the problem last year by overwrite the pre  batch, post batch, etc. calls.

 

George Zou
0 Kudos
Message 3 of 5
(1,586 Views)

Instead of modifying the Batch process model you can just run the Single Pass execution entry point (Ctrl-F5) from the Execute menu.  If running from a custom User Interface; then try the appropriate button control to the same Single Pass execution entry point.  This will run the Batch test one time 

0 Kudos
Message 4 of 5
(1,546 Views)

That's not going to work for my case.

I'm using Single execution in TestStand.

The main seq is in sequential model; a subseq is in batch model, called repeatedly.

 

 

George Zou
0 Kudos
Message 5 of 5
(1,544 Views)