| Contents | Index |
The following table describes the properties and property values for all mpt.Parameter and mpt.Signal data objects that appear in the Model Explorer.
Note You can create mpt.Signal and mpt.Parameter objects in the base MATLAB or model workspace. However, if you create the object in a model workspace, the object's storage class must be set to auto. |
The figure below shows an example of the Model Explorer. When you select an mpt.Parameter or mpt.Signal data object in the middle pane, its properties and property values display in the rightmost pane.
In the Properties column, the table lists the properties in the order in which they appear on the Model Explorer. Another table describes the effects that example changes to property values have on the generated code.

Parameter and Signal Property Values
| Class: Parameter, Signal, or Both | Property | Available Property Values (* Indicates Default) | Description |
|---|---|---|---|
Both | *auto | Prenamed and predefined property sets that are registered in the sl_customization.m file. (See Registering mpt User Object Types.) This field is unavailable if no user object type is registered. Select auto if this field is available but you do not want to apply the properties of a user object type to a selected data object. The fields on the Model Explorer are populated with default values. | |
Any user object type name listed | Select a user object type name to apply the properties and values that you associated with this name in the sl_customization.m file. The fields on the Model Explorer are automatically populated with those values. | ||
Parameter | *0 | The data type and numeric value of the data object. For example, int8(5). The numeric value is used as an initial parameter value in the generated code. | |
Both | Used to specify the data type for an mpt.Signal data object, but not for an mpt.Parameter data object. The data type for an mpt.Parameter data object is specified in the Value field above. See Working with Data Types in the Simulink documentation. | ||
Both | *null | Units of measurement of the signal or parameter. (Enter text in this field.) | |
Both | *-1 | The dimension of the signal or parameter. For a parameter, the dimension is derived from its value. | |
Both | *auto real complex | Complexity specifies whether the signal or parameter is a real or complex number. Select auto for the code generator to decide. For a parameter, the complexity is derived from its value. | |
Signal | *-1 | Model or block execution rate. | |
Signal | *auto | Determines how the signal propagates through the model. Select auto for the code generator to decide. | |
The signal propagates through the model one sample at a time. | |||
The signal propagates through the model in batches of samples. | |||
Both | *0.0 | The minimum value to which the parameter or signal is expected to be bound. | |
Any number within the minimum range of the parameter or signal. (Based on the data type and resolution of the parameter or signal.) | |||
Both | *0.0 | Maximum value to which the parameter or signal is expected to be bound. (Enter information using a dialog box.) | |
Note that an auto selection for a storage class tells the build process to decide how to declare and store the selected parameter or signal. | |||
Both | Code generation decides how to declare the data object. | ||
Both | Global (Custom) is the default storage class for mpt data objects. | Specifies the code generator to place no qualifier in the data object's declaration. | |
Both | *Default | Memory section allows you to specify storage directives for the data object. Default specifies that the code generator places no type qualifier and no pragma statement with the data object's declaration. | |
Parameter | Places the const type qualifier in the declaration. | ||
Both | Places the volatile type qualifier in the declaration. | ||
Parameter | Places the const volatile type qualifier in the declaration. | ||
Both | Name of the file used to import or export the data object. This file contains the declaration (extern) to the data object. Also, you can specify this header filename between the double-quotation or angle-bracket delimiter. You can specify the delimiter with or without the .h extension. For example, "object.h" or "object" has the same effect. For the selected data object, this overrides the general delimiter selection in the #include file delimiter field on the Configuration Parameters dialog box. | ||
Both | *Blank | The name of the module that owns this signal or parameter. This is used to help determine the ownership of a definition. For details, see Ownership Settings and Effects of Ownership Settings. | |
Both | *Blank | Name of the file that defines the data object. | |
Any valid text string | |||
Both | The number you specify is relative to Signal display level or Parameter tune level on the Code Placement pane of the Configuration Parameters dialog box. For a signal, allows you to specify whether or not the code generator declares the data object as global data. For a parameter, allows you to specify whether or not the code generator declares the data object as tunable global data. See Signal display level and Parameter tune level in Code Generation Pane: Code Placement. | ||
Both | Embeds Boolean data in a named bit field. | ||
Name of the struct into which the object's data will be packed. | |||
Parameter | Places the const type qualifier in the declaration. | ||
Parameter | Header file | See above. | |
Parameter | Owner | See above. | |
Parameter | Definition file | See above. | |
Parameter | Persistence level | See above. | |
Both | Places the volatile type qualifier in the declaration. | ||
Both | Header file | See above. | |
Both | Owner | See above. | |
Both | Definition file | See above. | |
Both | Persistence level | See above. | |
Parameter | Places the const volatile type qualifier in declaration. | ||
Parameter | Header file | See above. | |
Parameter | Owner | See above. | |
Parameter | Definition file | See above. | |
Parameter | Persistence level | See above. | |
Parameter | Represents parameters with a #define macro. | ||
Parameter | Header file | See above. | |
Both | Generates global variable definition, and generates a user-specified header (.h) file that contains the declaration (extern) to that variable. | ||
Both | Memory section | See above. | |
Both | Header file | See above. | |
Both | Definition file | See above. | |
Both | Includes predefined header files containing global variable declarations, and places the #include in a corresponding file. Assumes external code defines (allocates memory) for the global variable. | ||
Both | Allows you to specify whether the identifier that corresponds to the selected data object stores data of a data type (Direct) or stores the address of the data (a pointer). | ||
Both | If you select Pointer, the code generator places * before the identifier in the generated code. | ||
Header file | See above. | ||
Both | Embeds data in a named struct to encapsulate sets of data. | ||
Both | Struct name | See above. | |
Signal | Reads (gets) and writes (sets) data using functions. | ||
Signal | Header file | See above. | |
Signal | Specify the Get function. | ||
Signal | Specify the Set function. | ||
Both | *null | As explained in detail in Applying Naming Rules to Identifiers Globally, for a Simulink or mpt data object (identifier), specifying a name in the Alias field overrides the global naming rule selection you make on the Configuration Parameters dialog box. | |
Any valid ANSI[a] C/C++ variable name | |||
Both | *null | Text description of the parameter or signal. Appears as a comment beside the signal or parameter's identifier in the generated code. | |
Any text string | |||
[a] ANSI is a registered trademark of the American National Standards Institute, Inc. | |||
Some Examples of the Effect of Property Value Changes on Generated Code
| What I noticed when inspecting the .c/.cpp file | Change I made to property value settings | What I noticed after regenerating and reinspecting the file |
|---|---|---|
Example 1: | In the Model Explorer, I clicked the data object GAIN. I noticed that the property value for its Memory section property is set at MemConst. I changed this to Default. | I notice two differences. One is that now GAIN is declared as a variable with the statement real_T GAIN = 5.0;. The second difference is that the declaration now is located in the MemConst memory section in the .c or .cpp file. |
Example 2: | I changed the Storage class selection to Define (Custom). | GAIN is no longer declared in the .c file as a MemConst parameter. Rather, it now is defined as a #define macro by the code #define GAIN 5.0, and this is located near the top of the .c file with the other preprocessor directives. |
Example 3: | On the Model Explorer, I notice that the property value for the Header file property is blank. I changed this to filename.h. (I chose the ANSI C/C++ double quote mechanism for the #include, but could have chosen the angle bracket mechanism.) Also, it is necessary that I make the user-defined filename.h available to the compiler, placing it either in the system path or local directory. | The #define GAIN 5.0 is no longer in this .c file. Instead, the #include filename.h code appears as a preprocessor directive at the top of the file. |
Example 4: | In the Model Explorer, I selected the data object data_in. I noticed that the Alias field is blank. I changed this to data_in_alias, which I know is a valid ANSI C/C++ variable name. | The identifier |
[a] ANSI is a registered trademark of the American National Standards Institute, Inc.
![]() | Data Types | Custom Storage Classes | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |