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 modelsldrtex_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, on theDesktop Real-Timetab, clickHardware Settings.

  2. In the Configuration Parameters dialog box, click theCode Generationnode.

  3. In theTarget selectionsection, click theBrowsebutton at theSystem target filelist.

  4. In theSystem target filebrowser, select the system target file for building aSimulink Desktop Real-Time™application,sldrt.tlc, and clickOK.

    The dialog box enters the system target filesldrt.tlc, the template makefilesldrt.tmf, and the make commandmake_rtwinto theCode Generationpane.

    If you have the Embedded Coder®product, you can build an ERT target application. To build an ERT target application, in theTarget selectionsection, click theBrowsebutton at theSystem target filelist. Clicksldrtert.tlc, and then clickOK.

    Although not visible in theCode Generationpane, when you clickOKyou also configure the external target interface MEX filesldrtext. This file allowsRun in Kernelmode to pass new parameters to the real-time application and to return signal data from the real-time application. The data is displayed inScopeblocks or saved with signal logging.

    Image of configuration parameters code generation tab

    Do not setDefault parameter behaviortoInlinedon theOptimizationnode underCode 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 theHardware Implementationnode. 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

    Image of configuration parameters hardward implementation tab

  6. ClickOK.

Related Topics