MPF Panes on the Configuration Parameters Dialog Box

The following tables define elements on each MPF-related pane on the Configuration Parameters dialog box. Elements that are not related to MPF are not described. Select Real-Time Workshop on the Select pane.

MPF Elements on Configuration Parameters Panes

PaneElementDescription

General

Ignore custom storage classes

To make module packaging features available, this check box must be cleared.

Comments

Simulink® data object descriptions

When this check box is selected, and you type text in the Description field of the Model Explorer, that text will appear beside the signal's or parameter's identifier in the generated code as a comment.

 

Custom comments (MPT objects only)

When selected, this check box allows you to add a comment above a signal or parameter's identifier in the generated code. You control the content of the comment by writing a function in M-code (.m file) or TLC-code (.tlc file), and specifying its filename in the Custom comments function field.

 

Custom comments function

In this field, you specify the .m filename or .tlc filename that contains the function mentioned just above. This field is available only when the Custom comments (MPT objects only) check box is selected.

Symbols

#define naming

This rule applies only to those parameters whose storage class you selected as Define in Creating mpt Data Objects with Data Object Wizard. Allows you to specify one rule by which all of these parameters change the same way. Then, they appear as identifiers in the generated code as you want.

  

For example, in Creating mpt Data Objects with Data Object Wizard, a parameter is named parama. For this parameter, you specified Define (Custom) in the Storage class field of the Model Explorer, and you specified its Value property as "1." So, in terms of ANSI®[a] C/C++ syntax, you have said #define parama 1;. Now you select Force upper case in the #define naming field of the Symbols pane of the Configuration Parameters dialog box. The result of all of this is as follows. "PARAMA" appears in the generated code file every time this parameter name appears. In the compiled executable file, "1" appears every time "PARAMA" appears in the generated code file.

In the #define naming field, select Custom M-function to write your own naming rule that changes all of these parameter names in the model to identifiers in the generated code, in the same way. Then you must write an M-function to accomplish this. For details on writing a MATLAB® function, see Functions in the MATLAB documentation.

Of course, there is a wide variety of possibilities. Some examples are

  • Remove all underscore characters in all signal names

  • Add underscores before a capital letter in all parameter names

  • Make all identifiers in the generated code uppercase

  

Then you save the function as a .m file, place it in any folder in the MATLAB path, and type its filename in the M-function field under the #define naming field.

Select Force upper case or Force lower case to change case as desired.

Select None to make no change to the #define names. With this selection, after code generation, all of them will appear as identifiers in the source code exactly as they appear in the model.

 

M-function

If you selected Custom M-function in the #define naming field, place the name of the .m file here, with or without the .m extension. Otherwise, ignore this field.

 

Parameter naming

Allows you to specify one rule by which all of the model's parameter names change the same way, so that they appear as identifiers in the generated code as you want. The selections in this field have the same functions as described above for #defines, except they apply to parameter names.

 

M-function

If you selected Custom M-function in the Parameter naming field, place the name of the .m file here, with or without the .m extension. Otherwise, ignore this field.

 

Signal naming

Allows you to specify one rule by which all of the model's signal names change the same way, so that they appear as identifiers in the generated code as you want. The selections in this field have the same functions as described above for #defines, except they apply to signal names.

 

M-function

If you selected Custom M-function in the Signal naming field, place the name of the .m file here, with or without the .m extension. Otherwise, ignore this field.

Templates

Code templates

A code template organizes all of the generated files that, primarily, contain functions but not identifiers.

 

Source file  (*.c) template

The source code template organizes C code files. These include, for example, the main .c or any of the .c files that contain functions that Real-Time Workshop® Embedded Coder™ software generates for the open model.

 

Header file  (*.h) template

The header code template organizes the .h file that includes the prototypes of these functions. (See Source file (*.c) template just above.)

 

Data templates

A data template organizes all of the generated files that contain only identifiers (data), not functions (code).

 

Source file (*.c)  template

The source data template organizes the .c file that contains definitions of variables of global scope.

 

Header file (*.h)  template

The header data template organizes the .h file that can contain declarations of variables of global scope. (See Source file (*.c) template just above.)

 

Custom templates

A custom template is a TLC callback script that allows you to customize generated code. The supplied (default) code template is example_file_process.tlc. You must uncomment a TLC line, as explained near the top of the file, to apply the script to generated code. You can modify example_file_process.tlc to create your own custom template. For details, see Custom File Processing in the Real-Time Workshop Embedded Coder documentation.

Data Placement

Data definition

In this field, you select the .c file where the definitions of variables of global scope will be located. You can place these in a single .c file that is separate from the .c files where the model's functions are located, if desired.

If you choose Data defined in single separate source file, the data source template specified in the Source file (*.c) template field of the Templates pane (for Data templates) will be used. This template file organizes the single separate source file. You must also specify the filename of this single separate source file itself in the Data definition filename field below.

Or, you can place these definitions in the .c files where the functions are located. To do this you select Data defined in source file. In this case, the source template will not be used. There may be one function .c file or multiple function .c files, based on the file partitioning previously selected for the model. If there are multiple files, and you select Data defined in source file, all of the definitions will be placed in their respective function files.

If you choose the default Auto, Real-Time Workshop Embedded Coder software determines where the definitions will be located.

 

Data definition filename

This field is available only if you selected Data defined in single separate source file in the Data definition field. Specify here the name of this source file.

 

Data declaration

In this field, you select the file where declarations will be located (extern, typedef and #define statements). You can place these in a single .h file that is separate from the .c files where the model's functions are located, if desired.

If you choose Data declared in single separate header file, the data header template specified in the Header file (*.h) template field of the Templates pane (for Data templates) will be used. This template file organizes the single separate header file. You must also specify the filename of this single separate header file itself in the Data declaration filename field below.

Or, you can place these declarations in the .c files where the functions are located. To do this you select Data declared in source file. In this case, the data header template will not be used. As mentioned previously, there may be one function .c file or multiple function .c files, based on the file partitioning previously selected for the model. If there are multiple files, and you select Data declared in source file, all of the declarations will be placed in their respective function files.

If you choose the default Auto, Real-Time Workshop Embedded Coder software determines where the declarations will be located.

 

Data declaration filename

This field is available only if you selected Data declared in single separate header file in the Data declaration field. Specify here the name of this header file.

 

#include file delimiter

This field allows you to select the #include file delimiter used in those generated files that contain the #include preprocessor directive for mpt data objects. This applies the selected delimiter to all mpt data objects, except any whose delimiter is overridden by the Header file field on the Model Explorer.

If you select Auto, Real-Time Workshop Embedded Coder software determines the delimiter.

If you select #include "header.h", the double-quotation delimiter is used.

If you select #include <header.h>, the angle-bracket delimiter is used.

 

Module naming

In this field, you select whether or not to name the module. This is used in conjunction with the Owner field of a data object in the Model Explorer to constitute what is termed "ownership." For details, see Ownership Settings and Effects of Ownership Settings.

If you do want to specify the module name, you can select the convenient Same as model. This avoids having to type in a name in the Module name field described below.

 

Module name

This field is available only if you selected User specified in the Module naming field. Type the desired module name according to ANSI C/C++ conventions for naming identifiers.

 

Signal display level

This field allows you to specify whether or not the code generator declares a signal data object as global data in the generated code. The number you specify in this field is relative to the number you specify in the Persistence level field in the Module Explorer. The Signal display level number is for all mpt signal data objects in the model. The Persistence level number is for a particular mpt signal data object.

 

Parameter tune level

This field allows you to specify whether or not the code generator declares a parameter data object as tunable global data in the generated code. The number you specify in this field is relative to the number you specify in the Persistence level field in the Module Explorer. The Parameter tune level number is for all mpt parameter data objects in the model. The Persistence level number is for a particular mpt parameter data object.

[a] ANSI is a registered trademark of the American National Standards Institute, Inc.


[a] ANSI is a registered trademark of the American National Standards Institute, Inc.

  


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