Set External 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 (matlab: open_system(docpath(fullfile(docroot, 'toolbox', 'sldrt', 'examples', 'sldrtex_model')))). It assumes that you have already loaded that model.

  1. In the Simulink window, and from the Simulation menu, click Model Configuration Parameters.

  2. 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 external 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.

    Do not set Default parameter behavior to Inlined on the Signals and Parameters node under Optimization. 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

  6. Click OK.

Was this topic helpful?