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

Use the Run in Kernel button to select the mode for simulation.

Use the Build button to build the real-time application.

Use the Connect button to connect to the model and kernel.

Use the Disconnect button to disconnect the real-time application from the model and kernel.

Use the Start button to run the real-time simulation.

Use the Stop button to 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