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
ExtU

Data from root Inport blocks

ExtY

Data from root Outport blocks

B

Block output signals

ConstB

Block outputs that have constant values

P

Block parameters

ConstP

Constant parameters

DW

Discrete block states

XDis

Status of enabled subsystems

InstP

Parameter arguments

SharedDSMShared local data stores

For additional structures, see System-generated identifiers (Embedded Coder).

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 (Embedded Coder).

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

See Also

(Embedded Coder)

Related Topics