sltest.testsequence.getProperty
Get Test Sequence block properties
Syntax
Description
returns a blockInfo
= sltest.testsequence.getProperty(blockPath
)blockInfo
structure containing properties of the
Test Sequence block specified by blockPath
.
returns blockInfo
= sltest.testsequence.getProperty(blockPath
,propertyName
)blockInfo
,
containing the value of propertyName
.
Examples
Programmatically Return and Set Test Sequence Block Properties
This example gets and sets properties for a Test Sequence block using the programmatic interface.
1. Load the model.
Model = 'sltestRollRefTestExample';
load_system(Model)
2. Get properties of the Test Sequence block.
blockInfo = sltest.testsequence.getProperty([Model '/Test Sequence'])
blockInfo = struct with fields:
Name: 'Test Sequence'
UpdateMethod: 'INHERITED'
SampleTime: '-1'
Description: ''
Document: ''
Tag: []
SupportVariableSizing: 1
SaturateOnIntegerOverflow: 1
InputFimath: 'fimath(......'
EmlDefaultFimath: 'Same as MATLAB Default'
EnableActiveStepData: 0
ActiveStepDataSymbol: ''
ActiveStepDataType: 'Enum'
ScenarioParameter: ''
Semantics: 'StateflowCompatible'
3. Get the Test Sequence block update method.
blockUpdateMethod = sltest.testsequence.getProperty(... [Model '/Test Sequence'],'UpdateMethod')
blockUpdateMethod = 'INHERITED'
4. Change the Test Sequence block update method and sample time.
sltest.testsequence.setProperty([Model '/Test Sequence'],... 'UpdateMethod','Discrete','SampleTime','0.1')
5. Enable active step data and set the data type to String
. Use this data type if you have duplicate step names in a single test sequence or across scenarios in the Test Sequence block.
sltest.testsequence.setProperty([Model '/Test Sequence'],... 'EnableActiveStepData',1,'ActiveStepDataType','String');
6. Check the changes.
blockInfo = sltest.testsequence.getProperty([Model '/Test Sequence'])
blockInfo = struct with fields:
Name: 'Test Sequence'
UpdateMethod: 'DISCRETE'
SampleTime: '0.1'
Description: ''
Document: ''
Tag: []
SupportVariableSizing: 1
SaturateOnIntegerOverflow: 1
InputFimath: 'fimath(......'
EmlDefaultFimath: 'Same as MATLAB Default'
EnableActiveStepData: 1
ActiveStepDataSymbol: 'Active_Step'
ActiveStepDataType: 'String'
ScenarioParameter: ''
Semantics: 'StateflowCompatible'
7. Close the model.
close_system(Model,0)
Getting the Active Step Enumeration Name
The ActiveStepEnumName
is a property of the
ActiveStepDataSymbol
, which is a property of the Test
Sequence block. To obtain the enumeration name of the active step, use this
code:
ts = sltest.testsequence.getProperty(... 'model/Test Sequence'); actstep = sltest.testsequence.readSymbol(... 'model/Test Sequence',ts.ActiveStepDataSymbol); enum_name = actstep.ActiveStepEnumName
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'
propertyName
— Test Sequence block property name
'Name'
| 'UpdateMethod'
| 'SampleTime'
| 'Description'
| 'Document'
| 'Tag'
| 'SupportVariableSizing'
| 'SaturateOnIntegerOverflow'
| 'InputFimath'
| 'FimathForFiConstructors'
| 'EnableActiveStepData'
| 'ActiveStepDataSymbol'
| 'ActiveStepDataType'
| 'ScenarioParameter'
| 'Semantics'
Name of a particular Test Sequence block property for which to get a value.
Example: 'Description'
Output Arguments
blockInfo
— Block properties or property value
struct
| character vector | logical
Output of block properties, or the value of a particular block property
Example: struct with fields
Example: char array
Example: logical
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 (한국어)