Main Content

Standard Data Structures in the Generated Code

By default, signal lines, block parameters, states, and other model data appear in the generated code as fields of standard structures. For general information, see How Generated Code Stores Internal Signal, State, and Parameter Data.

The table shows some common data structures in the generated code. The name of the structure type and, if applicable, structure variable in the code that you generate from a model depends on the model settings. Regardless of the settings, the name of the structure type in the code contains the short name from the Short Name of Structure Type column in the table.

Data Structures Generated for a Model

Short Name of Structure TypeData Represented in the Structure

Data from root Inport blocks


Data from root Outport blocks


Block output signals


Block outputs that have constant values


Block parameters


Constant parameters


Discrete block states


Status of enabled subsystems


Parameter arguments

SharedDSMShared local data stores

For additional structures, see System-generated identifiers.

You can exclude data from appearing in these structures by using:

Control Characteristics of Data Structures (Embedded Coder)

To control the characteristics of the standard data structures, use the information in the table.

NameHow to Change Name
Structure typesSpecify a naming rule to use for the types. Set a value for Configuration Parameters > Global types.
Global structure variablesSpecify a naming rule with Configuration Parameters > Global variables.
Names of structure fieldsBy default, the name of each structure field derives from the name of the data item in the model (for example, the name of a block state, which you specify by using the State name block parameter). Specify a naming rule with Configuration Parameters > Field name of global types.
Data types of structure fieldsUse Simulink.AliasType objects and data type replacement to rename primitive types for the corresponding data items in the model. See Control Data Type Names in Generated Code.

For more information about configuration parameters that control names and other identifiers in the generated code, see Customize Generated Identifiers.

See Also

Related Topics