Main Content

Prepare Run in Kernel Mode Application

In Run in Kernel mode, you must first create an executable target application. The Simulink® Coder™ code generation software creates C code from your Simulink model. The bundled C compiler compiles and links that C code into a real-time application.

This procedure uses the model sldrtex_model. To open this model, in the MATLAB® Command Window, type:

openExample('sldrtex_model')

It assumes that you have already loaded that model.

  1. In the Simulink Editor, from the Apps tab, click Desktop Real-Time.

    This operation selects configuration parameters for use by the Simulink Coder code generation software. See Set Run in Kernel Mode Code Generation Parameters.

  2. On the Desktop Real-Time tab, click Run in Real Time.

  • The Simulink Coder code generation software creates the C code source files sldrtex_model.c and sldrtex_model.h.

  • The build process creates the makefile sldrtex_model.mk from the template makefile sldrt.tmf.

  • The build process creates the real-time application by using sldrtex_model.mk. On Windows®, the build process creates the binary file sldrtex_model.rxw64. On macOS, the build process creates the binary file sldrtex_model.rxm64.

    The binary file sldrtex_model.rx*64 is referred to as a real-time application. You can run the real-time application with the Simulink Desktop Real-Time™ kernel.

After you create a real-time application, you can exit MATLAB, and restart MATLAB again, and connect and run the executable without rebuilding your code. For more information, see Execute Real-Time Application in Run in Kernel Mode by Using Step by Step Commands.

Related Topics