Editing Steps in a Sequence
- Updated2025-03-28
- 10 minute(s) read
You can add a step to a sequence, configure the step to call a code module or subsequence, and configure the properties of a step.
The Insertion Palette contains a set of predefined step types you can add to sequences. Step types define the standard behavior and a set of step properties for each step of that type. All steps of the same type have the same properties, but the values of the properties can differ.
When you build sequence files, you can also use the Templates list in the Insertion Palette. Use the Templates list to hold copies of steps, variables, and sequences you reuse during the development of sequence files. For example, you can add a step that calls a specific LabVIEW VI you typically use or a sequence that contains common setup steps, cleanup steps, and local variables.
Adding a New Step
Complete the following steps to add a Pass/Fail Test step to a sequence and configure the step to call a function in a LabWindows/CVI DLL code module by specifying the module adapter to use. TestStand does not need the source code to invoke a DLL code module. Instead, TestStand uses module adapters to determine the type of code module, how to call the code module, and how to pass parameters to the code module.
- Open <TestStand Public>\Tutorial\Computer.seq.
- Select File»Save <filename> As and save the sequence file as Computer2.seq in the <TestStand Public>\Tutorial directory. Note When you must save a file, this tutorial specifies the suggested name. If other users will use the tutorial files on the same computer, save the files with unique filenames.
-
Select the LabWindows/CVI adapter from the Adapter ring control above the Step Types list to specify the module adapter the step uses. The adapter you select applies only to the step types that can use the module adapter.
Note If you left the Tutorial.tsw workspace open after completing the Loading and Running Sequences tutorial, you might need to click the Insertion Palette tab to show the Insertion Palette.When you insert a step in a sequence, TestStand configures the step to use the adapter you selected from the Insertion Palette. The icon for the step reflects the adapter you selected. When you select <None> as the adapter and then insert a step, the new step does not call a code module. Use the General panel on the Properties tab of the Step Settings pane to change the associated adapter after you insert the step.
-
On the Insertion Palette, select Tests»Pass/Fail Test and drag the step below the RAM step on the Steps pane to add a Pass/Fail Test step. By default, the name of the new step is Pass/Fail Test.
Note You can also create steps by right-clicking the Steps pane, selecting Insert Step from the context menu, and selecting the type of step you want to insert.Use a Pass/Fail Test step to call a code module that returns a pass/fail determination. After the code module executes, the Pass/Fail Test step evaluates a Boolean expression to determine whether the step passed or failed.
- Rename the new step Video Test by selecting the step on the Steps pane and pressing the <F2> key.
- Save the changes. Leave the sequence file open for the next tutorial.
Specifying the Code Module
Complete the following steps to specify the code module the step executes and to specify the parameters for a function in the code module for the Computer2.seq sequence file you created in the previous tutorial.
- Select the Video Test step and click the Module tab of the Step Settings pane.
- Click the Browse button located to the right of the Module control, select <TestStand Public>\Tutorial\computer.dll, and click Open. When you select a DLL, TestStand reads the type library or exported information of the DLL and lists the functions TestStand can call in the Function ring control.
- Select VideoTest from the Function ring control. TestStand uses the prototype information stored in the type library or the exported information of the DLL to populate the Parameters Table.
- In the Value Expression column of the result parameter, enter Step.Result.PassFail. When TestStand returns from calling the VideoTest function during execution, TestStand assigns the value from the result parameter to the Step.Result.PassFail property of the step.
- Save the changes. Leave the sequence file open for the next tutorial.
For more information about calling code modules, refer to the following tutorials:
- Calling LabVIEW VIs
- Calling LabWindows/CVI Code Modules
Configuring Step Properties
Each step in a sequence contains properties. All steps have a common set of properties that determine the following attributes:
- When to load the code module for the step
- When to execute the step
- What information TestStand examines to determine the status of the step
- Whether TestStand executes the step in a loop
- What conditional actions occur after a step executes
Steps can also contain additional properties the step type defines. Use the Properties tab of the Step Settings pane to examine and modify the values of properties of a step.
Complete the following steps to examine and modify step properties in the Computer2.seq sequence file you created in the previous tutorial.
- Select the Video Test step on the Steps pane and click the Properties tab of the Step Settings pane.
- Click Preconditions on the Properties tab to show the Preconditions panel.
A precondition is a set of conditions for a step that must evaluate to True for TestStand to execute the step during the normal flow of execution in a sequence.
- Complete the following steps to define a precondition so the Video Test step executes only if the Power On step passes.
- Click the Precondition Builder button, located to the right of the Precondition Expression control on the Preconditions panel, to launch the Precondition Builder dialog box.
- In the Insert Step Status section, select the Power On step from the list of step names for the Main step group and click the Insert Step Pass button. The Conditions control now contains the string PASS Power On, which indicates that the step executes only if the Power On step passes.
- Click OK to close the Precondition Builder dialog box and confirm that the Preconditions panel displays the expression you created.
- Click Post Actions on the Properties tab of the Step Settings pane to show the Post Actions panel, on which you can specify what type of action occurs after the step executes. You can make the action conditional on the pass/fail status of the step or on any custom condition expression.
- Select Terminate execution from the On Fail ring control.
-
Click Looping on the Properties tab of the Step Settings pane to show the Looping panel, on which you can configure an individual step to run repeatedly in a loop when the step executes. Use the Loop Type ring control to select the type of looping for the step.
TestStand determines the final status of the step based on the number of passes, failures, or loop iterations that occur.
-
On the Looping panel, enter the following values into the corresponding controls. When you change the value of a property, TestStand shows the new value in bold to indicate that it differs from the default value.
- Loop Type—Fixed number of loops
- Number of Loops—10
- Loop result is Fail if—<80%
Using these settings, TestStand executes the Video Test step 10 times and sets the overall status for the step to Failed if fewer than 8 of the 10 iterations pass.
- Confirm that the Settings column on the Steps pane of the Sequence File window shows that the Video Test step contains Loop, Precondition, and Post Action settings. Use the tooltip in the Settings column to verify the values for each setting.
- Save the changes and select Execute»Single Pass.
- Select the Video test to fail and click Done. The sequence immediately terminates after calling the Video Test step 10 times in a loop. TestStand records the result of each loop iteration in the report.
- Close the Execution window.
Calling Subsequences
Use the Sequence Call step to call another sequence in the current sequence file or in another sequence file.
Complete the following steps to add a Sequence Call step to the Computer2.seq sequence file you created in the previous tutorial.
- Insert a Sequence Call step after the Power On step on the Steps pane and rename the step CPU Test.
- On the Module tab of the Step Settings pane for the CPU Test step, click the Browse button located to the right of the File Pathname control and select <TestStand Public>\Tutorial\CPU.seq to specify the sequence the step invokes.
- Select MainSequence from the Sequence ring control on the Module tab of the Step Settings pane.
- Save the changes and double-click the CPU Test step to open the sequence and show the MainSequence of CPU.seq in a new Sequence File window.
- Select Execute»Run MainSequence. Examine the execution of CPU.seq so you can recognize it later when you execute the Computer2.seq sequence file that calls CPU.seq.
- Close the Execution window and the CPU.seq Sequence File window.
- In the Computer2.seq Sequence File window, select Execute»Single Pass.
- Select a test to fail and click Done. After the sequence executes, review the test report. TestStand logs the results of the steps in the subsequence in addition to the steps from the parent sequence.
- Close the Execution window. Leave the Computer2.seq sequence file open for the next tutorial.
Using Step Templates
The Insertion Palette contains the Step Types list and the Templates list. Use the Templates list to hold copies of steps, variables, and sequences you reuse during the development of sequence files. For example, you can add a step that calls a specific LabVIEW VI you typically use or a sequence that contains common setup steps, cleanup steps, and local variables.
Drag steps from the Steps pane, variables from the Variables pane, and sequences from the Sequences pane and drop them on the Templates list to add steps, variables, or sequences to the Templates list. Use the context menu to rename, copy, paste, delete, import, and export the items in the Templates list. You can drag and drop items to rearrange the list. Select Insert Folder from the context menu to add folders to the list. TestStand stores the settings for the Templates list, including any modifications to the list, in the <TestStand Application Data>\Cfg\Templates.ini file.
You cannot directly modify templates. Drag a sequence, step, or variable from the Templates list to a sequence file to edit the item. Then, drag the item back to the Templates list and delete the original item from the Templates list.
Inserting a Template Step
Complete the following steps to import a set of template steps to the Insertion Palette, insert a step from the Templates list in a sequence, and add a new step to the Templates list in the Computer2.seq sequence file you created in the previous tutorial.
- Right-click the Steps folder in the Templates list of the Insertion Palette and select Import from the context menu.
- Navigate to the <TestStand Public>\Tutorial directory, select Tutorial Templates.ini, and click Open. The sequence editor adds a Tutorial folder under the Steps folder.
- Expand the Tutorial subfolder of the Steps folder to view the following imported template steps:
- Retry if Previous Step Fails—A Message Popup step that prompts you to retry the previous step on failure.
- Open Notepad—A Call Executable step configured to launch the Microsoft Notepad application.
- Output Message—A statement step that logs an output message in which the logged text is the step name.
- Waveform Popup—A step that calls the WaveformGraphPopup function in the LabWindows/CVI user interface library.
- In the Templates list, select Retry if Previous Step Fails, drag the step below the Power On step on the Steps pane, and rename the step Retry Power On.
- Save the changes and select Execute»Single Pass.
- Select the Power On test to fail and click Done. TestStand executes the Retry Power On step and launches the Step 'Power On' Failed dialog box because the precondition for the step determined that the previous Power On step failed.
- Click Retry in the Step 'Power On' Failed dialog box to execute the Power On step again. The Power On step fails again, and TestStand launches the Step 'Power On' Failed dialog box again.
- Click Continue in the Step 'Power On' Failed dialog box to continue the execution.
- Review the report. Notice that the Power On step executed twice, and the second call to Retry Power On continued the execution.
- Close the Execution window. Leave the sequence file open for the next tutorial.
Creating a Template
Step
Complete the following steps to update the Retry Power On step so that it automatically selects the Continue button if you do not respond to the prompt in the Computer2.seq sequence file you created in the previous tutorial.
- In the Sequence File window, select the Retry Power On step on the Steps pane.
- Click the Text and Buttons tab of the Step Settings pane.
- In the Button Options section, select Button 2 from the Timeout Button ring control.
- Enter 20 in the Time To Wait control to instruct the step to wait for 20 seconds before continuing. This technique is useful if an operator is not present to acknowledge a non-critical message during testing.
- Save the changes and select Execute»Single Pass.
- Select the Power On test to fail and click Done. TestStand executes the Retry Power On step and launches the Step 'Power On' Failed dialog box. Do not take any action in this dialog box. When the timeout reaches zero, the execution continues as if you clicked Continue.
- In the Sequence File window, drag the Retry Power On step into the Tutorial folder in the Templates list.
- Rename the new template step Timeout Retry. You can use the new template step in subsequent development. The sequence editor automatically saves the templates list when you shut down the sequence editor.
- Close the Computer2.seq sequence file and the Execution window.
- You no longer need the Tutorial folder in the Templates list, and you can delete the folder if you want. Right-click the Tutorial folder in the Templates list and select Delete from the context menu to remove the folder.