Documentation

sltest.testsequence.editTransition

Edit test sequence step transition

Syntax

sltest.testsequence.editTransition(blockPath,stepPath,index,Name,Value)

Description

sltest.testsequence.editTransition(blockPath,stepPath,index,Name,Value) edits transition index in stepPath of the Test Sequence block blockPath. Transition properties are specified by Name,Value.

Examples

collapse all

This example adds a transition to a test step, then changes the transition's index, condition, and next step of the first transition in the step.

1. Load the model.

cd(matlabroot);
Model = 'sltestRollRefTestExample';
load_system(fullfile(matlabroot,'examples','simulinktest',Model));

2. Add a transition to the step AttitudeLevels.APEngage.LowRoll. The transition destination is the step AttitudeLevels.APEngage_End.

sltest.testsequence.addTransition('sltestRollRefTestExample/Test Sequence',...
'AttitudeLevels.APEngage_LowRoll','TurnKnob ~= 0',...
'AttitudeLevels.APEngagement_End')

3. Edit the transition index, condition, and next step of the first transition.

sltest.testsequence.editTransition('sltestRollRefTestExample/Test Sequence',...
'AttitudeLevels.APEngage_LowRoll',1,'Index',2,...
'NextStep','AttitudeLevels.APEngage_HighRoll',...
'Condition','duration(DD_PhiRef == 0,sec) >= 5')

4. Close the model.

close_system(Model,0)

Input Arguments

collapse all

Path to a Test Sequence block, including the block name, specified as a character vector.

Example: 'FanSpeedTestHarness/Test Sequence'

Path of the step in the Test Sequence block, specified as a character vector. The path includes the step location in the Test Sequence hierarchy, using . to separate hierarchy levels.

Example: 'SystemHeatingTest.InitializeHeating'

Integer specifying the transition in the test step to be edited. Corresponds to the integer displayed in the Transition cell of the Test Sequence Editor.

Example: 3

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'Condition','error == 1','NextStep','Stop','Index', 3

collapse all

The condition on which the transition executes, specified as a character vector. To execute the transition, enter a valid logical expression.

Example: 'theta == 0 && a == 1'

The name of the destination step of the transition, which is next in the sequence if the transition condition is satisfied.

Example: 'RampAngle'

Integer specifying the new transition index to be applied

Example: 'Index',2

Introduced in R2017a

Was this topic helpful?