Main Content

Execute Real-Time Application in Run in Kernel Mode by Using Step by Step Commands

After you build the real-time application, you can run your model in real time. In Run in Kernel 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. To open this model, in the MATLAB® Command Window, type:

openExample('sldrtex_model')

It shows how to use Step by Step Commands to complete simulation operations as individual steps.

Buttons

Step by Step Command Operations

Image of Run in Kernel button

Select Run in Kernel mode for simulation.

Image of Build button

Build the real-time application.

Image of Connect button

Connects the model and kernel.

Image of Disconnect button

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

Image of Start button

Start running the real-time simulation.

Image of Stop button

Stop running the real-time simulation.

  1. Open the model sldrtex_model.

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

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

    Simulink builds the real-time application.

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

    Simulink connects the model and kernel.

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

    Simulink starts running the simulation.

  6. 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. In the Simulink Editor, on the Desktop Real-Time tab, click Mode > Run in Kernel.

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

    Simulink connects the model and kernel.

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

    Simulink starts running the simulation.

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

Related Topics