Main Content

sltest.harness.clone

Copy test harness

Description

sltest.harness.clone(HarnessOwner,HarnessName) clones the test harness HarnessName associated with the model or component HarnessOwner. The cloned harness contains the source harness model contents, configuration settings, and callbacks.

sltest.harness.clone(HarnessOwner,HarnessName,NewHarness) uses an additional argument NewHarness to specify the name of the cloned harness.

sltest.harness.clone(HarnessOwner,HarnessName,Name,Value) clones the test harness HarnessName associated with HarnessOwner using additional options specified by one or more Name,Value pair arguments.

Examples

collapse all

Create a test harness ControllerHarness1 for the Controller subsystem of the model f14. Clone the harness and save it as ControllerHarness2.

openExample('f14')
sltest.harness.create('f14/Controller','Name',...
   'ControllerHarness1','SynchronizationMode',...
   'SyncOnOpenAndClose')
sltest.harness.clone('f14/Controller',...
   'ControllerHarness1','ControllerHarness2')

Clone the test harness ControllerHarness1 created in the previous step to the Aircraft Dynamics Model subsystem and save it as ControllerHarnessClone.

sltest.harness.clone('f14/Controller',...
   'ControllerHarness1','DestinationOwner',...
   'f14/Aircraft Dynamics Model','Name',...
   'ControllerHarnessClone')

Input Arguments

collapse all

Model or component handle or path, specified as a character vector or a double.

Example: 1.9500e+03

Example: 'myModel'

Example: 'myModel/Controller'

The name of the source harness, specified as a character vector.

Example: 'ControllerHarness'

The name of the cloned harness, specified as a character vector. If no value is specified, a default value is automatically generated.

Example: 'ControllerHarness2'

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'DestinationOwner','model3/Controller3','Name','newClonedHarness'

Owner block to which the test harness is cloned, specified as the comma-separated pair consisting of 'DestinationOwner' and a character vector.

Example: 'DestinationOwner','model3/Controller3'

The name of the cloned test harness, specified as the comma-separated pair consisting of 'Name' and a character vector. If no value is specified for Name, a default value is automatically generated.

Example: 'Name','newClonedHarness'

Version History

Introduced in R2015b