In TestStand, process models are implemented as sequence files with the process model option enabled, which allows them to contain additional types of model specific sequences. The sequence file type is configured in the Advanced tab of the Sequence File Properties. These sequence types each have specific behavior:
- Execution Entry Points allow users to execute tests using a desired process model sequence.
- Configuration Entry Points provide a user interface for users to configure process model settings, and store those setting.
- Model Callbacks allow the Test Sequence file to override process model behavior.
Use the Model tab of the Sequence Properties dialog box to configure the types of sequences a process model file can contain.
Execution Entry Point Sequences
Execution entry points provide a way for users to execute their test code via the process model. The default TestStand process model provides two Execution entry points, Test UUTs and Single Pass. Each of these entry points are implemented in a sequence in the process model sequence file. In the sequence editor, the Execute menu lists execution entry points when the active window contains a sequence file that uses the process model.
The Sequential process model uses the Single Pass and Test UUTs Execution entry points. Both Execution entry points call the MainSequence sequence of the client sequence file to execute tests for one UUT at a time. The entry points also share other actions, such as generating test reports and storing data results in a database.
Single Pass and Test UUT Execution Entry Point Flow in Sequential Process Model
The entry point name expression is the name that appears in the Sequence Editor or in a user interface while using the entry point. Use the Entry Point Name Expression text box on the Model tab of the Sequence Properties dialog box to edit this value. The Entry Point Name Expression text box is visible only when the sequence you select is an Execution entry point. A default value, such as ResStr("MODEL", "TEST_UUTS"), uses the ResStr function, which features TestStand localization. Replace the value with another localized value or use a constant string expression that describes the entry point from the point of view of a user.
Using localization strings instead of a constant has the benefit of allowing you to make changes to the string value without the need for modifying the process model itself. For more information on using TestStand resource strings for localization, refer to the Localizing TestStand to Different Languages Tutorial.
Configuration Entry Points
Configuration entry points provide a way for users to configure the settings for the process model. The default models contain the Model Options and Result Processing entry points. Similar to execution entry points, configuration entry points are implemented in a sequence in the process model file and are listed in the Configure menu in the sequence editor. To save settings, the model entry points write data to configuration files in the TestStand configuration directory.
Model callbacks allow test developers to customize certain aspects of the process model for their particular test, without making changes to the process model itself. The process model defines callback sequences that the entry points call at various points in execution. For example, the Test UUTs entry point calls the PreUUT callback sequence before beginning the test to prompt the user for a serial number. If a test developer requires a specific change to this functionality, they can override the callback in their test sequence file. In this case, when the model calls the PreUUT sequence, the sequence in the test sequence file is called instead of the PreUUT sequence in the process model file.
For a detailed description of process model callbacks, refer to the Using Callbacks in NI TestStand document.
The test sequence file can override callback sequences in the process model to define custom behavior
Process Model Plug-Ins
The default process models use a plug-in architecture to implement result processing, including report generation and database logging. Each plug-in is implemented in a separate sequence file which contains plug-in entry point sequences which are called at various points in the main process model entry points. The process models also provide a plug-in configuration dialog that allows test developers to configure which plug-ins are active and configure plug-in settings.
For more information on the TestStand process model plug-in architecture, refer to the Process Model Plug-in Architecture help topic.
Additional Engine Callbacks
Process Model sequence files provide additional engine callbacks that are not available in standard sequence files. These callbacks, which have the prefix “ProcessModel”, execute only for steps in the current client sequence file of the process model where you define them. For example, the ProcessModelPostStep callback executes after each step that executes in the Test Sequence but does not execute after steps in the process model itself.
A common application for these callbacks is custom error handling. Typically, test developers want to extract as much information as possible from errors and want control over system behavior when errors occur. In other use cases, subcontracted, fully automatic environments typically require start/stop inputs and red/green light outputs with appropriate debug logging to trace previous system and test error activity.
You can use the ProcessModelPostStepFailure and the ProcessModelPostStepRuntimeError Engine callbacks defined at the process model level to generically handle errors from all client sequence files without requiring extra effort from the test sequence programmer. These callbacks execute if an error occurs in the client sequence file.