Build and Configure Test Sequences in TestStand
- Updated2024-10-31
- 11 minute(s) read
Build and Configure Test Sequences in TestStand
After you configure the VeriStand connection, as detailed in Configuring TestStand, use TestStand to build sequences using steps. The following steps appear in the TestStand Insertion Palette in the VeriStand folder:

Add the steps into a sequence from the TestStand Insertion Palette pane by either double-clicking the step or dragging the step into the Steps: Sequence pane. Once you have a step to a sequence, select the step to view the Step Settings pane.
Run Real-Time Sequence Step
Use this step to run a real-time sequence and optionally wait for it to complete.
Refer to the following sections for more information about the configuration options available on the Real-Time Sequence Configuration and Result Behavior tabs in the Step Settings pane.
Real-Time Sequence Configuration Tab
) to view a list of all real-time sequences available in the
VeriStand project directory (selected using the Configure VeriStand Connection tool,
detailed in Configuring TestStand). Click the Browse button (
) to select any real-time sequence file on disk. Relative paths
are used where possible. To evaluate the absolute path, first the project directory is
checked, followed by all TestStand search directories. The evaluated absolute path is
displayed in the indicator directly under Real-Time Sequence. For the Web UI, the
real-time sequence file must be either in the main test sequence folder hierarchy or the
Shared folder hierarchy. Refer to Loading Battery Test Package Files for
more information.
) button to create a new real-time sequence
file from TestStand. Clicking this prompts for the new file name, creates the new file
on disk, then opens the file in the VeriStand Stimulus Profile Editor.
) button to edit an existing real-time
sequence file in the VeriStand Stimulus Profile Editor. This is only enabled when a
real-time sequence file is selected. Result Behavior Tab
Stop Real-Time Sequence Step
Use this step to either stop or abort a real-time sequence.
Configure the following fields on the Stop Configuration tab of the Step Settings pane.
- Real-Time Sequence Reference—Set this field to a valid real-time sequence reference. A valid real-time sequence reference can be returned as a call to either the Run Real-Time Sequence Step or the Get Deployed Real-Time Sequences Step. These must be stored in PropertyObjects of the Object Reference type.
- Stop Action—Select Stop (recommended, default) or Abort.
To retrieve results from a stopped sequence, you must use the Wait for Real-Time Sequence Completion Step after stopping it. Sequences stopped using this mechanism continue to be returned by the Get Deployed Real-Time Sequences step until the Wait for Real-Time Sequence Completion step is called on the sequence reference.
Wait for Real-Time Sequence Completion Step
Use this step to wait for a real-time sequence to complete and/or retrieve the results from a real-time sequence.
This step is used in conjunction with the Run Real-Time Sequence Step, which has either been configured to not wait for result or has timed out.
Configure the following fields on Configuration tab of the Step Settings pane.
- Sequence Reference—Set this field to a valid real-time sequence reference. A valid real-time sequence reference can be returned from a call to either the Run Real-Time Sequence Step or the Get Deployed Real-Time Sequences Step. These must be stored in PropertyObjects of the Object Reference type.
- Result—(Optional) You must enter a valid expression evaluating to a PropertyObject of the appropriate type. The result of the real-time sequence is written to the PropertyObject defined in this field. This PropertyObject is not written to in the case of a timeout.
- Timeout Enabled—When enabled, the step exits after the number of seconds provided in Timeout Expression (seconds) have elapsed. If the step times out, no result is written to the PropertyObject defined in Result. When Timeout Causes Run-Time Error is enabled, the step generates an error if a timeout occurs. A developer can read the Step.Result.TimedOut flag to check if a step timed out.
Get Deployed Real-Time Sequences Step
Use this step to retrieve information on all currently deployed real-time sequences.
By default, results are stored to the array at Step.Result.ActiveSequences, but you can change to any other PropertyObject of the same data structure.
Configure the following field on the Configuration tab of the Step Settings pane:
Deployed Real-Time Sequence Info—Defines the location to which deployed real-time sequence information is stored. The only sequences that are returned are real-time sequences either started asynchronously with the Run Real-Time Sequence Step or started synchronously with the Run Real-Time Sequence step and have timed out. Real-time sequences are listed on future TestStand runs if the gateway remains active (requiring that TestStand is configured not to un-deploy on shutdown).
Real-time sequences no longer appear in this list after their results are returned, either with the Wait for Real-Time Sequence Completion Step or by calling the Run Real-Time Sequence step synchronously.
Real-time sequences running on the gateway that are not launched by the TestStand steps are not returned by this step.
This step returns an array of type NI_VsSequenceState, which contains the following fields for each deployed sequence:
- SequenceReference—A reference to the sequence that can be used by other steps.
- FullSequenceFilePath—The absolute path to the real-time sequence file.
- State—An enum representing the state of the sequence, as defined by VeriStand.
Read Real-Time Sequence States Step
Use this step to return the state of one or more real-time sequences.
Configure the following options on the Real-Time Sequences tab of the Step Settings pane.
Use the plus (
) and minus (
) buttons to add or remove
sequences.
For each entry, provide the following:
- Real-Time Sequence Reference—Set this field to a valid real-time sequence reference. A valid real-time sequence reference may be returned a call to either the Run Real-Time Sequence Step or the Get Deployed Real-Time Sequences Step. These must be stored in PropertyObjects of the Object Reference type.
- State—Set this field to a resulting state mapped to a valid location. By default, all step results are mapped to an array of State enums at Step.Result.States. You can opt to map these results to any Number, String, or NI_VsSequenceState PropertyObject.
Read/Write Channels Step
Use this step to either read or write channel values.
You can configure more than one channel at a time. There may be a delay between writing a value to a channel and when that value is set and readable due to the nature of the VeriStand Engine. When multiple channels are configured, they are executed in the order they are entered.
Configure the following options on the Channels tab of the Step Settings pane.
Use the plus (
) and minus (
) buttons to add or remove
channels.
For each entry, provide the following:
- Channel—Select channels from a list of all available channels defined in the selected .vsaliases file or the configured VeriStand project.
- Units—Displays a unit if there is one associated with the channel.
- Action—Select Read or Write.
- Expression—For Read channels, provide an expression that evaluates to a PropertyObject of type Number. For Write channels, provide an expression that evaluates to a number.
Enable/Disable Alarms Step
Use this step to enable or disable alarms. You can configure one or more alarms at a time.
Configure the following options on the Alarms tab of the Step Settings pane.
Use the plus (
) and minus (
) buttons to add or remove
alarms.
For each entry, provide the following:
- Alarm Name—Select alarms from a list of all available alarms defined in the selected .vsaliases file or the configured VeriStand project.
- Enabled?—Provide an expression that evaluates to a Boolean.
Read Alarm States Step
Use this step to read the state of one or more alarms from VeriStand.
Configure the following options on the Alarms tab of the Step Settings pane.
Use the plus (
) and minus (
) buttons to add or remove
alarms.
For each entry, provide the following:
- Alarm Name—Select alarms from a list of all available alarms defined in the selected .vsaliases file or the configured VeriStand project.
- State—Set this field to a resulting state mapped to a valid location. By default, all alarm states are mapped to an array of State enums at Step.Result.AlarmStates. You can opt to map these results to any Number, String, or NI_AlarmStateEnum PropertyObject.
Save/Retrieve/Clear State Data Step
Use this step to save, retrieve, or clear state information to or from VeriStand in situations when VeriStand is running on a separate machine from TestStand.
Configure the following options on the State Action tab of the Step Settings pane.
-
Behavior—Select one of the following states:
- Save State—Saves data to VeriStand.
- Retrieve State—Retrieve data from VeriStand.
- Clear State—Clears any data for the defined state from VeriStand.
- Clear All States—Clears all state data currently stored in VeriStand.
- Lookup Name—For Save State and Retrieve State, this field provides a string that you can use to retrieve state information. NI recommends that you define this name as a TestStand variable to limit erroneous string entries. For Clear State, use this field to define a string that identifies the state.
- Data Object—For Save State and Retrieve State, use this field to define the data to be stored, including any TestStand PropertyObject containers and arrays. Note that object references may no longer be valid when retrieved. Ensure that this PropertyObject matches the data structure of the state information that was originally written with the state.
- Already Existed?—(Optional) Set a Boolean variable to indicate whether a state with the same Lookup Name exists. For Save State, when state data with the same Lookup Name exists, it is overwritten with this new state data. For Retrieve State, if a state had not previously existed, no error is thrown. Instead, the Already Existed? flag is set to False and no data is updated.
Read/Write Connection Settings Step
Use this step to either read from or write to the saved VeriStand connection settings.
Configure the following options on the Connection Settings tab of the Step Settings pane.
- Behavior—Select Read or Write.
- Connection Settings—Set an expression that evaluates to a container. For Read mode, the current VeriStand Connection Settings are read from the system and stored to the defined container. For Write mode, the current VeriStand Connection Settings on the system are set to the values in the defined container. The container must be of type NI_VsConnectionSettings. By default, the connection is configured to a container at Step.Result.ConnectionSettings of the appropriate type (NI_VsConnectionSettings). You can opt to set a different read/write location, if it is of type NI_VsConnectionSettings.
When TestStand is running a sequence that is already connected to VeriStand, then the updates will not take effect until the next time that TestStand attempts to connect to VeriStand. Because of this, NI recommends using only the Read/Write Connection Settings step in sequence file callbacks that are called before a sequence attempts to connect to VeriStand. Suggested callbacks are SequenceFileLoad and ProcessSetup. Conversely, if the Read/Write Connection Settings step is being used to revert settings to what they were before a sequence was run, the recommended callbacks to use are SequenceFileUnload and ProcessCleanup. Note that these callbacks are applicable when using one of the standard TestStand process models, but this may not be the case if using a custom process model.
Related Information
- Configuring TestStand
- Loading Battery Test Package Files
The environment of the BTS is defined for the Web UI using packages of XML configuration files called battery test packages. These packages contain information on the DUTs, test stations, monitored signals, and test definitions that can be used to configure and run tests through the Operator UI. Once these files have been written, they need to be validated and loaded into long-term storage to be used by the Web UI. You can load your battery test packages into long-term storage using the Package Loader page in the BTS Web UI.
- Terminating and Aborting Executions
- Set Safe Checkpoints in TestStand
- Update Specific VeriStand Connection Settings in TestStand