Main Content

Data and Function Interfaces

Map model data elements and functions to code definitions

To comply with code standards and guidelines and configure the representation of model data elements and entry-point functions for code generation, map model data elements and functions to predefined code definitions.

For an introduction, see C Data Code Interface Configuration for Model Interface Elements.

Tools

Code Mappings EditorAssociate model elements with code interface definitions (Since R2020b)

Objects

coder.mapping.api.CodeMappingModel data and function interface configuration for C code generation (Since R2020b)

Functions

expand all

model_initializeGenerated C/C++ entry-point function that contains initialization code for a Simulink model
model_resetGenerated C/C++ entry-point function that contains reset code for a Simulink model
model_stepGenerated C/C++ entry-point function that contains execution code for each step in a Simulink model
model_terminateGenerated C/C++ entry-point function that contains termination code for a Simulink model

Create and Find Code Mappings

coder.mapping.api.getGet code mappings for model (Since R2020b)
coder.mapping.utils.createCreate code mappings object for configuring data and function interface for C and C++ code generation (Since R2020b)
findGet model elements for the category of model code mappings (Since R2020b)

Default Configurations

getDataDefaultGet default storage class or storage class property setting for model data category (Since R2020b)
setDataDefaultSet default storage class and storage class property values for model data category (Since R2020b)

Root-Level Inport and Outport Configuration

getInportGet code and calibration configuration from code mappings for root-level inport (Since R2020b)
getOutportGet code and calibration configuration from code mappings for root-level outport (Since R2020b)
setInportConfigure root-level inports for code and calibration file (a2l) generation (Since R2020b)
setOutportConfigure root-level outport for code and calibration file (a2l) generation (Since R2020b)

Parameter Configuration

getModelParameterGet code and calibration configuration from code mappings for model parameters (Since R2020b)
setModelParameterConfigure model parameter for code and calibration file (a2l) generation (Since R2020b)

Signal, State, and Data Store Configuration

addSignalAdd block output signal to model code mappings (Since R2020b)
getDataStoreGet code and calibration configuration from code mappings for local or shared local data store (Since R2020b)
getSignalGet code and calibration configuration from code mappings for block output signal (Since R2020b)
getStateGet code and calibration configuration from code mappings for block state (Since R2020b)
removeSignalRemove block output signal from model code mappings (Since R2020b)
setDataStoreConfigure local or shared local data store for code and calibration file (a2l) generation (Since R2020b)
setSignalConfigure block signal data for code and calibration file (a2l) generation (Since R2020b)
setStateConfigure block states for code and calibration file (a2l) generation (Since R2020b)

Topics

Configuration Fundamentals

Data Configuration

Function Configuration

Data Access and Initialization

Featured Examples