帮助中心帮助中心
本页采用了机器翻译。点击此处可查看英文原文。
读取 Test Sequence 模块符号属性
symbolInfo = sltest.testsequence.readSymbol(blockPath,symbol)
symbolInfo = sltest.testsequence.readSymbol(blockPath,symbol,Property)
symbolInfo = sltest.testsequence.readSymbol(blockPath,symbol) 返回 blockPath 指定的 Test Sequence 模块中 symbol 的属性结构 symbolInfo。
symbolInfo
blockPath
symbol
symbolInfo = sltest.testsequence.readSymbol(blockPath,symbol,Property) 返回 symbol 的 Property 的值 symbolInfo。
Property
全部折叠
此示例编辑 Test Sequence 模块中的常量 DurationLimit,将其更改为 single 数据类型的局部变量。
DurationLimit
single
1.加载模型。
Model = 'sltestRollRefTestExample'; load_system(Model)
2.搜索包含单词 duration 的数据符号。
duration
data_names = sltest.testsequence.findSymbol... ('sltestRollRefTestExample/Test Sequence','Name','[Dd]uration',... 'RegExp','on','Kind','Data')
data_names = 1x1 cell array {'DurationLimit'}
3.读取 DurationLimit 常量的属性。
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.将 DurationLimit 更改为 single 数据类型的局部变量。
sltest.testsequence.editSymbol('sltestRollRefTestExample/Test Sequence',... data_names{1},'Scope','Local','DataType','single')
5.关闭模型。
close_system(Model,0)
Test Sequence 模块的路径,包括模块名称,指定为字符串或字符向量。您可以使用模块句柄,而不是模块路径。
示例: 'FanSpeedTestHarness/Test Sequence'
'FanSpeedTestHarness/Test Sequence'
Test Sequence 模块符号名称,指定为字符向量。符号包括用作 Test Sequence 模块中的输入、输出、局部变量、常量、参数或数据存储内存的数据、消息、函数调用和触发器。
示例: 'DurationLimit'
'DurationLimit'
Test Sequence 模块符号属性,指定为字符向量。要找到特定符号的有效属性,请使用 sltest.testsequence.readSymbol(blockPath,symbol) 读取该符号的属性。
sltest.testsequence.readSymbol(blockPath,symbol)
示例: 'Kind'
'Kind'
示例: 'Scope'
'Scope'
示例: 'DataType''Description'
'DataType'
'Description'
Test Sequence 模块符号的属性。
示例: struct
struct
在 R2017a 中推出
sltest.testsequence.addSymbol | sltest.testsequence.deleteSymbol | sltest.testsequence.findSymbol | sltest.testsequence.readStep | sltest.testsequence.readTransition
sltest.testsequence.addSymbol
sltest.testsequence.deleteSymbol
sltest.testsequence.findSymbol
sltest.testsequence.readStep
sltest.testsequence.readTransition
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office