Passing Data to a Subsequence with Parameters in TestStand

Updated Nov 30, 2017

Reported In

Software

  • TestStand 2016 SP1
  • TestStand 2014 SP1
  • TestStand 2014

Issue Details

I've created a subsequence that requires data from the main sequence. How do I pass this data?

Solution

In TestStand, data can be passed from a sequence to a subsequence with parameters using the following steps:
  1. Right-click Parameters in the Variables pane to add a parameter that will be passed to the subsequence.
  2. In the subsequence, select the Parameters tab. Right-click in the right pane to create the parameters which will be passed into the subsequence.
  3. If you want the subsequence to be able to modify the parameter(s), they must be specified by reference (this is the default setting). You can right-click on an individual parameter to uncheck Pass by Reference.
  4. Save your subsequence.
  5. Open your sequence which will call the subsequence. If you haven't created a sequence call step, do so now.
  6. Right-click on the sequence call step to specify a module. Using the File Pathname and Sequence controls, specify your subsequence. TestStand will fill in the Parameters control to reflect the parameters that you created in your subsequence. For each parameter, use the Enter Expression control to specify what data will be passed to the parameter when the subsequence is called. The calling sequence can pass in the data from anywhere: StationGlobals, Locals, its Parameters, or FileGlobals.
  7. Optionally, you can choose to use the default parameter value that is specified in the subsequence.
Optionally, you can choose to use the default parameter value that is specified in the subsequence.

Additional Information

Passing By Reference 
If a parameter is specified By Reference, the subsequence can modify the data that was passed in. If the subsequence modifies the data, the data will be modified when it is returned to the calling sequence. If a parameter is not specified By Reference, when the subsequence is called, a copy of the data is made and the copy is passed to the subsequence. The subsequence can modify the copy of the data while the calling sequence will have the unmodified original data.

Must I Use Parameters to Pass Data? 
You can use StationGlobals or FileGlobals to pass data from one sequence to another. However, Parameters provides for orderly passing of data from one sequence to another sequence. If you are running parallel executions, Parameters are essential to prevent corruption of data by limiting scope.

WAS THIS ARTICLE HELPFUL?

Not Helpful