Target.Stimulation
说明
Target.Stimulation 对象表示对运行在 Speedgoat® 目标计算机上的模型的根输入端口或 Playback 模块的激励。
该对象提供对以下方法的访问:
启动或停止根部输入端口或 Playback 模块的激励。
暂停根部输入或 Playback 模块激励。
返回根输入端口或 Playback 模块模拟的状态。
重新加载根输入端口或 Playback 模块的数据信号。
创建对象
当您使用 slrealtime 命令创建 Target 对象时,会生成一个 Target.Stimulation 对象。在创建计算机并将其连接到 Target 对象后,即可访问 Target.Stimulation 对象。此示例创建并连接到 Target 对象 tg,随后在目标计算机上启动根输入端口或 Playback 模块的激励过程。
打开模型 slrt_ex_osc_inport 并添加一个额外的输入端口。
tg = slrealtime; mdlSTF = getSTFName(tg); mdlName = 'slrt_ex_osc_inport'; openExample(mdlName); set_param(mdlName,"SystemTargetFile",mdlSTF); load('slrt_ex_inport_square.mat'); waveform = square; set_param(mdlName,'ExternalInput','waveform'); set_param(mdlName,'LoadExternalInput','on'); set_param(mdlName,'StopTime','Inf');
构建模型。加载实时应用程序。开始执行。开始激励。
slbuild(mdlName); connect(tg); load(tg,mdlName); start(tg,'StartStimulation','off'); start(tg.Stimulation,'all');
对象函数
getStatus | Return status of root inports stimulation of model on target computer |
pause | Pause stimulation of root inports of model on target computer |
reloadData | Reload data signal of root inports of model on target computer |
start | Start stimulation of root inports of model on target computer |
stop | Stop stimulation of root inports of model on target computer |
示例
版本历史记录
在 R2021a 中推出