Main Content

Set Run in Kernel Mode Code Generation Parameters

After you create a Simulink® model, you can enter simulation parameters. Simulink Coder™ uses these parameters for creating C code and building a real-time application.

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


It assumes that you have already loaded that model.

  1. In the Simulink Editor, on the Desktop Real-Time tab, click Hardware Settings.

  2. In the Configuration Parameters dialog box, click the Code Generation node.

  3. In the Target selection section, click the Browse button at the System target file list.

  4. In the System target file browser, select the system target file for building a Simulink Desktop Real-Time™ application, sldrt.tlc, and click OK.

    The dialog box enters the system target file sldrt.tlc, the template makefile sldrt.tmf, and the make command make_rtw into the Code Generation pane.

    If you have the Embedded Coder® product, you can build an ERT target application. To build an ERT target application, in the Target selection section, click the Browse button at the System target file list. Click sldrtert.tlc, and then click OK.

    Although not visible in the Code Generation pane, when you click OK you also configure the external target interface MEX file sldrtext. This file allows Run in Kernel mode to pass new parameters to the real-time application and to return signal data from the real-time application. The data is displayed in Scope blocks or saved with signal logging.

    These settings appear in the code generation tab of the configuration parameters dialog box.

    Do not set Default parameter behavior to Inlined on the Optimization node under Code Generation. Inlining parameters is for custom targets when you want to reduce the amount of RAM or ROM with embedded systems. Also, if you select inlining parameters, you disable the parameter tuning feature. Do not inline parameters because PCs have more memory than embedded systems.

  5. Click the Hardware Implementation node. The default values are derived from the architecture of the development computer. For example, for a 64-bit Intel® machine, they are:

    • Device vendorIntel

    • Device typex86-64

    These settings appear in the hardware implementation tab of the configuration parameters dialog box.

  6. Click OK.

Related Topics