Documentation

sltest.testsequence.addTransition

Add new transition to test sequence step

Syntax

sltest.testsequence.addTransition(blockPath,fromStep,condition,toStep)

Description

sltest.testsequence.addTransition(blockPath,fromStep,condition,toStep) creates a test step transition in the Test Sequence block blockPath. The transition executes on condition, from the origin fromStep, to the destination toStep. fromStep and toStep must be at the same hierarchy level.

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 an existing step in the Test Sequence block, specified as a character vector, at which the transition originates. The path must include the step name and step hierarchy, using . to separate hierarchy levels. This step must be at same level as toStep.

Example: 'topStep.midStep.step1'

The condition on which the transition executes, specified as a character vector. Though specified as a character vector, it must be a valid logical expression for the transition to execute.

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

Path of an existing step in the Test Sequence block, specified as a character vector, which becomes active step after the transition executes. The path must include the step name and step hierarchy, using . to separate hierarchy levels. This step must be at same level as fromStep.

Example: 'topStep.midStep.step2'

Introduced in R2016a

Was this topic helpful?