06-29-2016 08:32 AM
Hello! I would like to ask what would be the best way to program this in TestStand. I have a sequence that has many UUT’s in batch mode. During the first of the sequence, the operator must load the parts and the test will do a simple voltage test. If the part is not loaded properly it will fail the voltage test.
Here are the conditions I would like to build in but I’m unsure how to build the expression or loop structure.
I’m just not sure of how to do the loop structure (DO while, or while ) expressions etc.
Thanks!
Solved! Go to Solution.
06-29-2016 09:06 AM
I assume you have TestStand set to use BatchModel.seq or maybe some customized variant.
In the PreBatch callback, I would do something like
For (Number of Loops = GetNumElements(Parameters.ModelData.TestSockets) )
Prompt user to load the nth UUT
Perform the voltage test
If (VoltageTestFailed)
Prompt User to reposition or Disable
End
End (For loop)
06-29-2016 10:19 AM
Consider this example. It uses the SequenceFilePostStepFailure.
Let me know if you have any questions.
Hope this helps,
06-29-2016 11:28 AM
I ended up doing it this way. Do you guys see anything wrong? Each UUT will have to be looked at so i put it as part of the main sequence
06-29-2016 11:42 AM
My opinion is that if you're trying to see if a UUT is installed correctly or needs to repositioned somehow, that ought to be in PreBatch. I try to reserve MainSequence steps for the actual tests and would like to assume that the UUTs have already been placed in the correct position by the time I get there. Also, if you want the user to be able to disable a test socket, that's definitely something to be handled in PreBatch.
06-29-2016 11:44 AM
As a general rule of thumb I try to avoid GO TOs and Breaks. They will work and get the job done. It is just hard to follow the code for maintenance reasons. Case in point: the sequential model used to contain GO TO steps. When they redid it they removed them all and used while loops, similar to what pulido did in his pseudo code above.
The great thing about the TestStand is there are 50 ways to do things. The worst thing about TestStand is that there are about 50 ways to do things...pick your poison.
Regards,
06-29-2016 12:51 PM
Ok so if I put it in the prebatch callback i have a few questions:
If (VoltageTestFailed)
Prompt User to reposition or Disable
End
06-29-2016 01:26 PM
When you put the PreBatch callback (or any other callback) in your client sequence, the code in your client sequence is what is called instead of what's in the model.
If it was me, I would get rid of the two default PreBatch steps and make my own prompts (in your desired language) that work within the loop. You would also have to populate the ModelData Container with all of the pertinent information, especially so you can tell TestStand which sockets are disabled.
I think the examples for overriding PreBatch are pretty good, so hopefully that's a good starting point.
<TestStand Public>\Examples\ProcessModels\BatchModel\OverrideSerialNumForBatchModel1.seq