NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change Number of test socket in Model option during run-time

I wanna be able to change the the number of test sockets(in the Model Options menu) during runtime. I have overriden the Prebatch callback and used my own instead. I have a LabView program in my Prebatch where I would select the test script each time before running the batch. I wann be able to also modify the number of test sockets each time before I run the batch again. I tried setting the "Parameters.ModelData.ModelOptions.NumTestSockets" from the Labview program which is in my Prebatch before running each batch, but get into errors. Please help?
0 Kudos
Message 1 of 5
(5,780 Views)
Hello Kumar,

You will want to override the ModelOptions callback in your sequence file, and launch the LabVIEW VI that prompts the user to enter the number of TestSockets. From within the ModelOptions callback, the correct TestStand property to set in your LabVIEW VI is Parameters.ModelOptions.NumTestSockets. Attached is a small example VI (LabVIEW 6.1) and sequence file (TestStand 2.0.1)that I used to make sure this works.

Thanks for contacting National Instruments!

David Mc.
NI
Download All
0 Kudos
Message 2 of 5
(5,780 Views)
Hi David,

Thank you so much for the information and files that you send. I can understand how to do this now.

But I have another problem, I am running a VI which prompts me to load the files to execute each time i run the batch. I have this VI embedded in the overridden PreBatch callback.

I set the "NumOfTestSocks" in the ModelOption callback and then hit the Execute->Test UUTs. The VI in the Prebatch is called and thats where I select the number of testcases to run depending on the value of "NumOfTestSocks" that I set earlier. So if I want to run a series of batch tests which involves one test case, I have to set "NumOfTestSocks" to 1 in the beginning.

I have to stop the sequence and run a series of batch which involves two testcases again, by set
ting "NumOfTestSocks" to 2 manually in the beginning.

How can run a series of batch test, which I can change the "NumOfTestSocks" and slect the number of files to run for each batch by supplying these parameters in my VI which I call in the overridden PreBatch callback.

Would really appreciate if you could guide.

Thanks
Kumar
0 Kudos
Message 3 of 5
(5,780 Views)
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
0 Kudos
Message 4 of 5
(5,780 Views)
Hi David,

Thanks again for the sample files and explanation, but I have rather a different situation instead. The problem with my testing is that I want to be able to modify the number of test sockets each time I run via the VI I have in the PreBatch Callback. I have attached the sequence file which calls the Prebatch_test VI and I want to pass in the TestSocket number here. Is it possible.

Thanks
Download All
0 Kudos
Message 5 of 5
(5,780 Views)