sltest.harness.setHarnessCreateDefaults
Syntax
Description
sltest.harness.setHarnessCreateDefaults(name = value)
sets and
registers the specified harness creation default values for the specified name-value
arguments. For a list of valid name-value arguments, see sltest.harness.create
.
sltest.harness.setHarnessCreateDefaults('Name',token)
sets the
harness name using tokens. You cannot use tokens with the
sltest.harness.create
function or 'Name' =
<value>
syntax.
The available tokens, which you can use singly or in combination, are:
$modelName$
— Name of the model$component$
— Name of the block or model that owns the harness$ownerPath$
— Path of the harness owner. If the harness owner is a block diagram,$ownerPath$
is the same as$modelName$
. If the harness owner is a block,$ownerPath$
is a block path in the owner model, where slash,/
, separators are replaced by underscores. Spaces, carriage returns, and leading or trailing spaces are removed.
Enter the tokens exactly as shown. The token values are replaced automatically with the values of the associated model name, component, and owner path.
Examples
Alternatives
As an alternative to using sltest.harness.setHarnessCreateDefaults
,
you can use an sl_customization.m
file to customize harness creation
default values. See Customize Test Harness Creation Default Property Values.
If you created an sl_customization.m
file, you can then use
sltest.harness.setHarnessCreateDefaults
to set additional default
values or overwrite the values defined in that file. If you create an
sl_customization.m
file and register it after using
sltest.harness.setHarnessCreateDefaults
, the default values that you
previously specified are overwritten with the default values in the file.
Version History
Introduced in R2021b