Main Content

reloadData

Reload data signal of root inports of model on target computer

Since R2021a

Description

example

reloadData(target_object.Stimulation, inport, tsName) reloads the data signal from a timeseries object to the specified root inport of the model running on the target computer.

example

reloadData(target_object.Stimulation, playback, loadSource) reloads the data signal from a timeseries object, a Simulink.SimulationData.Dataset object, or pairs of ports and timeseries objects for the specified Playback block in the model running on the target computer.

Examples

collapse all

To load data to an inport, create a time series object.

  1. sampleTime = 0.1; %sample time of the model
    endTime = 10; %end time of the model
    numberOfSamples = endTime * 1/sampleTime + 1;
    timeVector = (0:numberOfSamples) * sampleTime;
    u = timeseries(timeVector*10,timeVector);
  2. Load the object to the inport named first.

    reloadData(tg.Stimulation,'first',u);
  3. To load the same object to multiple inports named first and third.

    reloadData(tg.Stimulation,'first',u,'third',u);

To load data to a Playback block, create a time series object.

  1. sampleTime = 0.1; %sample time of the model
    endTime = 10; %end time of the model
    numberOfSamples = endTime * 1/sampleTime + 1;
    timeVector = (0:numberOfSamples) * sampleTime;
    u = timeseries(timeVector*10,timeVector);
  2. Load the object to the Playback block named first.

    reloadData(tg.Stimulation,'first',u);
  3. To load the objects playbackData1 and playbackData2 to a Playback blocks named first and its ports 1 and 2.

    reloadData(tg.Stimulation,'first',{{1,playbackData1},{2,playbackData2}});

Input Arguments

collapse all

Provides access to methods that manipulate the target computer properties.

Example: tg

Specifies the name of the inport or inport number or block path of the inport present on the model running on the target computer.

Example: {'signal_1'}, [2], {'model_name/in4'}

Specifies a timeseries object to load into the inports.

Example: u

Specifies the name of the Playback block or block path of the Playback block present in the model running on the target computer.

Example: {'signal_1'}, [2], {'model_name/in4'}

Specifies a timeseries object or Simulink.SimulationData.Dataset object to load into the Playback block. Alternatively, specifies pairs of port numbers and timeseries object to load into the Playback block.

Example: {{1,playbackData1},{2,playbackData2}}

Version History

Introduced in R2021a