Main Content

sltest.testsequence.addTransition

Add new transition to test sequence step

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.

Model = 'sltestRollRefTestExample';
load_system(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 string or character vector. Instead of the block path, you can use a block handle.

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'

Version History

Introduced in R2016a