Documentation

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, seeHow Generated Code Stores Internal Signal, State, and Parameter Data(Simulink Coder).

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结构类型的短名称column in the table.

Data Structures Generated for a Model

结构类型的短名称 Data Represented in the Structure
ExtU

Data from rootInportblocks

ExtY

Data from rootOutportblocks

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

For additional structures, seeSystem-generated identifiers(Simulink Coder).

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

控制水资源teristics of Data Structures (Embedded Coder)

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

Name How to Change Name
Structure types Specify a naming rule to use for the types. Set a value forConfiguration Parameters>Global types.
Global structure variables Specify a naming rule withConfiguration Parameters>Global variables.
Names of structure fields By 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 theState nameblock parameter). Specify a naming rule withConfiguration Parameters>Field name of global types.
Data types of structure fields UseSimulink.AliasTypeobjects and data type replacement to rename primitive types for the corresponding data items in the model. SeeControl Data Type Names in Generated Code.

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

See Also

Related Topics