Documentation

Test Sequence Editor

Input, Output, and Data Management

Manage inputs, outputs, and data objects using the Symbols sidebar of the Test Sequence Editor. Click the symbols sidebar button on the toolbar to show or hide the sidebar. To add a symbol, mouse over the symbol type and click Add. To edit or delete a data symbol, mouse over the data symbol and click Edit or Delete.

If you add a symbol to the test sequence block, you can access that symbol from test steps at any hierarchy level. For information on using messages, see Test Sequence Action and Transition Operations.

Symbol TypeDescriptionProcedure for Adding

Input

Inputs can be data or messages.

Click Add in the sidebar and enter the input name.

Output

Outputs can be data, messages, or function calls.

Click Add in the sidebar and enter the output name.

Local

Local data entries are available inside the test sequence block in which they are defined.

Add a local variable in the sidebar and initialize the local variable in the first test step.

Constant

Constants are read-only data entries available inside the test sequence block in which they are defined.

Add a constant in the sidebar. Click Edit and enter the constant value in the dialog box, in the Initial Value field.

Parameter

Parameters are data available inside and outside the Test Sequence block.

Using the Model Explorer, add a parameter in the workspace of the model containing the Test Sequence block. Then add the parameter name to the Parameter symbols.

Data Store Memory

Data Store Memory entries are available inside and outside the Test Sequence block.

Using the Model Explorer, add a Simulink®.signal entry in the workspace of the model containing the Test Sequence block. Alternatively, add a Data Store Memory block to the model. Then add the data store memory name to the Data Store Memory symbols.

Add and Delete Test Steps

To add a test step, right-click a step in the editor. Select Add step before or Add step after. Select Add sub-step to create a test step in a lower hierarchy level.

To delete a test step, right-click the step. Select Delete step. If the sequence contains only one test step, you cannot delete it. You can delete the contents by selecting Erase last step content.

Copy Test Steps

You can cut or copy test steps, and paste them before or after another step. You can also paste them in a hierarchy below another step. Right-click the test step and select Cut step or Copy step. To paste, right-click another test step and select Paste step > Paste before step or Paste step > Paste after step. To paste in a lower hierarchy, select Paste step > Paste sub-step.

You can also use Ctrl+X, Ctrl+C, and Ctrl+V shortcuts.

Reorder Test Steps and Transitions

You can reorder test steps from the editor. Hover over the icon to the left of the step name. Click and drag the icon to reorder the test step. Test steps can be reordered within the same hierarchy level. Sub-steps are also moved with the test step.

You can reorder step transitions within the same test step. Hover over the transition number. Click and drag the number to reorder the transition. The corresponding next step is maintained.

Change Test Step Hierarchy

Change a test step's hierarchy level by indenting or outdenting the test step. Right-click the test step, and select Indent step to move it to a lower level, or Outdent step to move it to a higher level.

  • Movign to a lower hierarchy level (indenting) requires a preceding step at the same hierarchy level. You cannot indent the first test step in a sequence or the first step in a hierarchy group.

  • Only the last step in a hierarchy group can be moved to a higher level (outdented).

Test Step Transition Behavior

Standard Transition

In a standard transition, the default step is the first step listed in the sequence. The sequence progresses according to the transition conditions and next steps. To create a sequence using standard transitions:

  • Add new steps to the sequence.

  • Define outputs and assessments in the Step cell. For example, this code sets on_off to false and verifies that the FanOn signal is true.

    on_off = false;
    verify(FanOn == true);
  • For each step that requires a transition, hover over the Transition cell and click Add transition. Define the step exit conditions in the transition. For example, this code transitions to another step after the current step has been active for 20 seconds.

    after(20,sec)
  • Choose the next test step in the Next Step cell.

When Decomposition Transition

In a When decomposition sequence, steps activate based on a signal condition defined on the same line as the test step name, preceded by the when operator. For example, a step named OverSpeed2 activates when the signal gear is 2:

OverSpeed2 when gear == 2

A When decomposition requires a parent step. To change to a When decomposition sequence, right-click the parent step and select When decomposition. The parent step displays the When decomposition icon . Add substeps to define the when conditions.

At each time step, the when statements evaluate from top to bottom, and the first step with a valid statement executes. The final step in a When decomposition cannot include a when condition. The final step handles situations in the simulation which do not match another when condition in the sequence. Conceptually, this is analogous to including an Else condition in an if-then-else construct.

See Also

| |

Related Topics

Was this topic helpful?