Execute Real-Time Application in External Mode by Using Step by Step Commands

After you build the real-time application, you can run your model in real time. In external mode, you execute your real-time application to observe the behavior of your model in real time by using the generated code.

This procedure uses the model sldrtex_model (matlab: open_system(docpath(fullfile(docroot, 'toolbox', 'sldrt', 'examples', 'sldrtex_model')))). It shows how to use Step by Step Commands to complete simulation operations as individual steps.

Buttons

Step by Step Command Operations

Build the real-time application.

Change to external mode simulation and connects the model and kernel.

Disconnect the real-time application from the model and kernel.

Change to external mode simulation and start running the real-time simulation.

Stop running the real-time simulation and change to normal mode simulation.

  1. Open the model sldrtex_model.

  2. In the Simulink® Editor, on the Desktop Real-Time tab, click Run in Real Time > Build.

    Simulink builds the real-time application.

  3. On the Desktop Real-Time tab, click Run in Real Time > Connect.

    Simulink changes to external mode simulation and connects the model and kernel.

  4. On the Desktop Real-Time tab, click Start.

    Simulink starts running the simulation.

  5. To stop the simulation before it ends, on the Desktop Real-Time tab, click Stop.

These Step by Step Commands let you run a real-time simulation for a previously built real-time application.

  1. If continuing from the previous procedure, close the model sldrtex_model.

  2. Open the model sldrtex_model.

  3. On the Desktop Real-Time tab, click Run in Real Time > Connect.

    Simulink changes to external mode simulation and connects the model and kernel.

  4. On the Desktop Real-Time tab, click Start.

    Simulink starts running the simulation.

  5. To stop the simulation before it ends, on the Desktop Real-Time tab, click Stop.

Related Topics