Main Content

Target.Stimulation

Target computer model root inport stimulator object

Description

A Target.Stimulation object represents the stimulation of root inports of the model running on the target computer.

The object provides access to methods that:

  • Start and stop the root inport stimulation.

  • Pause the root inport stimulation.

  • Return the status of the root inport stimulation.

  • Reload the data signal of the root inport.

Creation

A Target.Stimulation object is created when you create a Target object by using the slrealtime command. After you create and connect the machine to the Target object, you can access the Target.Stimulation object. This example creates and connects to Target object tg, and then starts the stimulation of root inports on the target computer.

tg = slrealtime('TargetPC1');
connect(tg);
load(tg,'myAppWithRootInports');
start(tg,'StartStimulation','off');
start(tg.Stimulation,'all');

Object Functions

getStatusReturn status of root inports stimulation of model on target computer
pausePause stimulation of root inports of model on target computer
reloadDataReload data signal of root inports of model on target computer
startStart stimulation of root inports of model on target computer
stopStop stimulation of root inports of model on target computer

Examples

collapse all

In a model with five inports, start the stimulation of inports named first and third.

start(tg.Stimulation,{'first','third'}); 
% if the port number of inport named 'first' is 1
% and the port number of inport named 'third' is 3
% this syntax is equivalent to:
%
% start(tg.Stimulation,[1,3]);

In a model with five inports, pause the stimulation of inports named first and third.

pause(tg.Stimulation,{'first','third'});
% this syntax is equivalent to:
% pause(tg.Stimulation,[1,3]);

In a model with five inports, stop the stimulation of inports named first and third.

stop(tg.Stimulation,{'first','third'}); 
% this syntax is equivalent to:
% stop(tg.Stimulation,[1,3]);
Introduced in R2021a