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.
In the Simulink Editor, on theDesktop Real-Timetab, clickHardware Settings.
In the Configuration Parameters dialog box, click theCode Generationnode.
In theTarget selectionsection, click theBrowsebutton at theSystem target filelist.
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 file
sldrt.tlc
, the template makefilesldrt.tmf
, and the make commandmake_rtw
into 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. Click
sldrtert.tlc
, and then clickOK.Although not visible in theCode Generationpane, when you clickOKyou also configure the external target interface MEX file
sldrtext
. 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.Do not setDefault parameter behaviorto
Inlined
on 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.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 vendor—
Intel
Device type—
x86-64
ClickOK.