Main Content

sltest.testsequence.getScenarioControlSource

Get source that controls Test Sequence active scenario

Description

example

scenarioCtrlSource = sltest.testsequence.getScenarioControlSource(blockPath) returns the source that controls the active scenario for the Test Sequence block specified by blockPath.

Examples

collapse all

Set the Test Sequence block in the sltestRollRefTestExample model to use scenarios. Set the control source to the workspace. Then, get the name of the source that controls the active scenario.

Model = 'sltestRollRefTestExample';
load_system(Model);

sltest.testsequence.useScenario...
   ('sltestRollRefTestExample/Test Sequence',...
   'Scenario_1');
sltest.testsequence.setScenarioControlSource...
   ('sltestRollRefTestExample/Test Sequence',...
    sltest.testsequence.ScenarioControlSource.Workspace);

scenarioControlSource = ...
   sltest.testsequence.getScenarioControlSource...
   ('sltestRollRefTestExample/Test Sequence')
scenarioCtrlSource = 

  ScenarioControlSource enumeration

    Workspace

Close the model without saving it.

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.

Example: 'FanSpeedTestHarness/Test Sequence'

Output Arguments

collapse all

Active scenario control source, returned as either of these enumerated values:

  • sltest.testsequence.ScenarioControlSource.Block — The active scenario is controlled by setting it in the Test Sequence block.

  • sltest.testsequence.ScenarioControlSource.Workspace — The active scenario is controlled by a workspace variable that specifies the index of the active scenario. The variable can be in the base workspace, model workspace, or data dictionary.

Introduced in R2020b