Main Content

Simulate Model in Connected IO Mode

To run a real-time simulation of a Simulink® Desktop Real-Time™ model, you can use Simulink Connected IO mode. This procedure uses the model sldrtex_model. To open this model, in the MATLAB Command Window, type:

open_system(docpath(fullfile(docroot,'toolbox',...
    'sldrt','examples','sldrtex_model')))

Load the model before you start the procedure.

  1. In the Simulink Editor, double-click the Scope block.

    The Simulink software opens a Scope window with an empty graph.

  2. On the Desktop Real-Time tab, select Mode > Connected IO for the simulation mode.

  3. Open the block parameters of the Real-Time Sync block in your Simulink Desktop Real-Time model.

  4. To prevent missed ticks, set values for the Sample Time and Maximum Missed Ticks block parameters.

  5. To begin simulation, on the Desktop Real-Time tab, click Run in Real-Time.

    The Simulink software runs the simulation and plots the signal data in the Scope window.

    Image of scope displaying signal from simulation

  6. To stop the simulation before it ends, on the Simulation tab, click Stop.

    The real-time application stops running. The Scope window stops displaying the output signals.

Related Topics