Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Workshop Embedded Coder   

Defining a Specific Global Data Object in Its Own File

The previous procedure placed all global data objects in a separate definition file, in one operation. You named that file global.c. (You named the corresponding declaration file global.h.) MPF allows you to override this and place a specific data object in its own definition file. In the following procedure, you move the Final signal to a file called finalsig.c, and keep all the other data objects defined in global.c:

  1. In the Model Explorer, display the base workspace and select the Final signal object. The mpt.Signal properties appear in the right pane.

  2. In the Code generation options section, type finalsig.h in the Header file text box, type finalsig.c in the Definition file text box, and click Apply.

  3. On the Real-Time Workshop General pane, clickGenerate code. The code generation report still lists global.c and global.h, but adds finalsig.c and finalsig.h.

  4. Open all four files to inspect them. Notice that the Final signal is defined in finalsig.c. All other data objects in the dictionary are defined in global.c.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS