How to Programmatically Change the UUT or Batch Serial Number in TestStand

Publish Date: Aug 11, 2017 | 0 Ratings | 0.00 out of 5 | Print | Submit your review

Overview

In TestStand, you are able to assign a serial number for a unit under test (UUT) or the entire batch of UUTs. This serial number can be modified programmatically during a TestStand execution by modifying the serial number string through a status expression. This is useful for an operator who would want to modify the serial number to include a date or the results of the test after execution has begun.

Table of Contents

  1. Before MainSequence
  2. In MainSequence
  3. After MainSequence
  4. Additional Resources

The serial number can be modified in three different locations with respect to the MainSequence.

1. Before MainSequence

Add the "PreUUT" model callback to your sequence file. Within this model callback, the batch serial number can be changed in a status expression by using the following parameters:

  • Parameters.ModelData.BatchSerialNumber modifies the batch serial number. This is only applicable to the Batch process model.
  • Parameters.UUT.SerialNumber modifies every test sockets' serial number, if using Batch or Parallel sequence models, or the UUT's serial number if not.
  • Parameters.ModelData.TestSockets[i].UUT.SerialNumber modifies the serial number of the test socket index specified by the variable  i. This is only applicable in a batch or parallel process model.

Note: These expressions in both cases will have to be added after the "DoPreUUT" sequence call. This sequence call executes the UUT dialogue box, where the operator has the option to enter serial numbers.

Back to Top

2. In MainSequence

During MainSequence, when execution begins, three properties will be created, and will not exist during development. You will still be able to modify these parameters in status expressions to modify the serial number. Similar to the Pre-MainSequence parameters, they are:

  • RunState.Root.Parameters.ModelData.BatchSerialNumber modifies the batch serial number. This is only applicable to the Batch process model.
  • RunState.Root.Locals.UUT.SerialNumber modifies every test sockets' serial number, if using Batch or Parallel sequence models, or the UUT's serial number if not.
  • RunState.Root.Parameters.ModelData.TestSockets[i].UUT.SerialNumber modifies the serial number of the test socket index  specified by the variable i. This is only applicable in a batch or parallel process model.

 

Back to Top

3. After MainSequence

After the MainSequence, any change to the UUT or batch serial number will not be reflected using the methods listed in the two previous sections. However, the batch serial number in the report can still be modified through model callbacks, "ModifyBatchBeportHeader" and "ModifyReportHeader." In both callbacks, a parameter for the report header, Parameters.ReportHeader, contains the value of the batch serial number, which can be updated. The first model callback will update the batch report header and the second model callback will modify each UUT's report header, respectively. There are two options to do this: 

  • The Find and Replace functions can be used in an expression in this model callbacks to parse through Parameters.ReportHeader in both model callbacks. First, the Find function would search for  the index of the current batch serial number, and then the Replace function would use this index to update the value with a new string.
  • A code module can be used to parse through Parameters.ReportHeader and to find the current value of the serial number and update that with a new string.

 

Back to Top

4. Additional Resources

Back to Top

Bookmark & Share


Downloads


Ratings

Rate this document

Answered Your Question?
Yes No

Submit