sltest.testsequence.findSymbol
Find Test Sequence block symbols
Description
returns symbols
= sltest.testsequence.findSymbol(blockPath
,Name,Value
)symbols
in
the Test Sequence block blockPath
matching
properties specified by Name,Value
pairs. Symbols
include data, messages, function calls, and triggers.
Examples
Find, read, and edit a Test Sequence block data symbol
This example edits constant DurationLimit
in the Test Sequence block, changing it to a local variable of single
data type.
1. Load the model.
Model = 'sltestRollRefTestExample';
load_system(Model)
2. Search for data symbols containing the word duration
.
data_names = sltest.testsequence.findSymbol... ('sltestRollRefTestExample/Test Sequence','Name','[Dd]uration',... 'RegExp','on','Kind','Data')
data_names = 1x1 cell array
{'DurationLimit'}
3. Read the properties of the DurationLimit
constant.
dlProperties = sltest.testsequence.readSymbol... ('sltestRollRefTestExample/Test Sequence',data_names{1})
dlProperties = struct with fields:
Kind: 'Data'
Scope: 'Constant'
DataType: 'double'
Description: ''
Document: ''
InitialValue: '5'
Name: 'DurationLimit'
Size: ''
Tag: []
4. Change DurationLimit
to a local variable of single
data type.
sltest.testsequence.editSymbol('sltestRollRefTestExample/Test Sequence',... data_names{1},'Scope','Local','DataType','single')
5. Close the model.
close_system(Model,0)
Input Arguments
blockPath
— Test Sequence block path or handle
string | character vector
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'
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: 'Kind','Message','Scope','Output'
Example: 'Kind','Data','Name','[Aa]ngle','RegExp','on'
Kind
— Data symbol type
'Data'
| 'Message'
| 'Function Call'
| 'Trigger'
The scope defines how the data symbol operates in the block. It is specified as a character vector.
Example: 'Data'
Scope
— Data symbol scope
'Input'
| 'Output'
| 'Local'
| 'Constant'
| 'Parameter'
| 'Data Store Memory'
Data symbol scope, specified as a character vector.
Example: 'Parameter'
Name
— Symbol name
character vector
The name of the test symbols to search
Example: 'Name','Engage'
Example: 'Name','[Dd]uration'
CaseSensitive
— Specify case-sensitive search
'on'
| 'off'
Specifies case
Example: 'CaseSensitive','on'
RegExp
— Specify regular expression search
'on'
| 'off'
Specify whether to search the step names using Name
as
a regular expression
Example: 'RegExp','on'
Output Arguments
symbols
— Block symbols
cell array
Cell array of Test Sequence block symbols matching search criteria
Example: cell
Version History
Introduced in R2017a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)