Data and Function Configuration

Configure model data elements model-independent code definitions

To comply with code standards and guidelines, integrate generated code with external code, and address memory requirements, you can control the declarations and definitions of functions, variables, and data types in generated code. For example, you can configure code generation for:

  • Data elements by associating the elements with storage classes

  • Reusable entry-point functions by setting model configuration parameters

  • C++ class interfaces by setting model configuration parameters


model_initializeInitialization entry-point function in generated code for Simulink model
model_stepStep routine entry point in generated code for Simulink model
model_terminateTermination entry point in generated code for Simulink model


Data Configuration

Choose Storage Class for Controlling Data Representation in Generated Code

Choose a storage class to apply to data elements in a model, such as signals, states, and block parameters.

Apply Storage Classes to Individual Signal, State, and Parameter Data Elements

Control data representation in the generated code by applying storage classes directly, which overrides the default storage classes that you specify in the Code Mapping Editor.

Configure Packaging of Parameter Arguments in Generated Code

Customize the implementation of parameter arguments in generated code.

Function Configuration

Execution of Code Generated from a Model

Execute code generated from single-tasking and multitasking models for rapid-prototyping and embedded system run-time environments.

Configure Code Generation for Model Entry-Point Functions

Learn about generated entry-point functions and ways to control their interfaces and whether the functions are reusable and reside in specific areas of memory.

Rapid Prototyping Model Functions

Generate rapid prototyping code.

Generate Reentrant Code from Top Models

Generate reusable, reentrant code from top models.

Generate C++ Class Interface to Model or Subsystem Code

Generate a C++ class interface to code generated from a model or subsystem.