Main Content

getStatus

Return status of root inports stimulation of model on target computer

Since R2021a

Description

example

getStatus(target_object.Stimulation,inports) returns the status of the stimulation of specified root inports of the model running on the target computer. The status of the stimulation can be:

  • RUNNING — indicates that stimulation is running

  • PAUSED — indicates that stimulation is paused

  • isFinished — indicates that stimulation data is finished

  • STOPPED — indicates that stimulation is stopped

example

getStatus(target_object.Stimulation,playbacks) returns the status of the stimulation of specified Playback blocks in the model running on the target computer. The status of the stimulation can be RUNNING, PAUSED, isFinished, or STOPPED.

example

getStatus(target_object.Stimulation,'all') returns the status of the stimulation of all root inports, Playback blocks, and tunable parameters in the model running on the target computer.

example

getStatus(target_object.Stimulation,blockPath) returns the status of the stimulation of the specified root inports, Playback blocks, and tunable parameters after the previous step in the model running on the target computer.

Examples

collapse all

Get the status of stimulation of inports named first and third.

status = getStatus(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:
%
% status = getStatus(tg.Stimulation,[1,3]);
status = 

  struct with fields:

    first: RUNNING
    third: RUNNING

Get the status of stimulation of Playback blocks named first and third.

status = getStatus(tg.Stimulation,{'first','third'});
status = 

  struct with fields:

    first: RUNNING
    third: RUNNING

Get the status of stimulation of all inports and Playback blocks.

tg.Stimulation.getStatus('all');

In a model with tunable parameters, get the stimulation status of parameters with block path slrt_ex_osc/Signal Generator. For more information finding the block path for parameters, see Simulink Real-Time Explorer.

getStatus(tg.Stimulation,'slrt_ex_osc/Signal Generator');

Input Arguments

collapse all

Provides access to methods that manipulate the target computer properties.

Example: tg

Specifies the numbers of the inports or names of the inports or block paths of the inports present on the model running on the target computer.

Example: [1,3,5], {'in1','in2'}, {'model_name/in1','model_name/in4'}

Specifies the block names or block paths of the Playback blocks present in the model running on the target computer. If you use a block name that is not unique (more than one block with that name is present) in the model, the function returns an error and suggests using block paths instead.

Example: {'pb1','pb2'}, {'model_name/pb1','model_name/pb4'}

Represents all the available root inports of the model running on the target computer.

Example: 'all'

The block_path values for tunable parameters in stimulation operations can be:

  • Empty character vector ('') or empty string scalar ("") for base or model workspace variables

  • Character vector or string scalar string for block path to parameters in the top model

  • Cell array of character vectors or string scalars for model block arguments

Example: '', 'Gain1', {'top/model','sub/model'}

Version History

Introduced in R2021a

expand all