Documentation

Prepare External Mode Application

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

  1. In the Configuration Parameters dialog box, enter parameters for use by the Simulink Coder code generation software. See Set External Mode Code Generation Parameters.

  2. On the toolbar, click the Build .

  • 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 Mac OS, it 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®, start MATLAB again, and then connect and run the executable without having to rebuild your code.

Was this topic helpful?