qc_connect_model qc_stop_model navigation bar

Table of Contents

qc_start_model

Starts a model in normal simulation or external mode.

Syntax

qc_start_model(model, mode) % Start a given model with the desired simulation mode
qc_start_model(model)       % Start a given model with the model's simulation mode
qc_start_model              % Start the current model with the model's simulation mode
    

Description

Starts a model's associated real-time code on a QUARC target if the simulation mode is external. If the simulation mode is normal then it starts a normal simulation.

Warning

Starting from Simulink R2019b, it is no longer possible to select simulation mode via Simulink menu due to the switch to use a toolstrip in Simulink.

In order to use this command to start a model in external mode, you either manually set the simulation mode via the set_param command as follow before calling this command:

set_param(model, 'SimulationMode', 'external');

or call the command as:

qc_start_model(model, 'external');

In order to use this command to start a model in normal mode, you either manually set the simulation mode via the set_param command as follow before calling this command:

set_param(model, 'SimulationMode', 'normal');

or call the command as:

qc_start_model(model, 'normal');

This command is equivalent to selecting Run from the Simulation toolstrip of the diagram for normal mode, or selecting Monitor & Tune from the Hardware toolstrip for external mode. In external mode, the model will be connected if it is not connected already, and then started.

If no model was specified then the current model as returned by bdroot is used.

If no mode was specified then the model's current SimulationMode is used.

Parameters

model

A string indicating the name of the model to start.

mode

A string indicating the desired model's SimulationMode to start the model with.

Outputs

This function has no outputs.

Examples

qc_start_model('q_a_lpbk');             % Starts the 'q_a_lpbk' model.
qc_start_model('q_a_lpbk', 'external'); % Starts the 'q_a_lpbk' model in external mode.		
    

See Also

 

navigation bar