Main Content

Data and Function Configuration

Configure code generation for data and functions to facilitate software integration

To generate code for rapid prototyping, configure the representation of model data elements for code generation. You configure model data elements by mapping them to code definitions (storage classes) that are predefined by the product.

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

Objects

coder.mapping.api.CodeMappingModel data and function interface configuration for C code generation
coder.mapping.api.CoderDictionaryQuery and set the code settings of dictionary defaults in an Embedded Coder dictionary within a Simulink data dictionary

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
coder.mapping.utils.createCreate code mappings object for configuring data and function interface for C and C++ code generation
findGet model elements for the category of model code mappings

Default Configurations

getDataDefaultGet default storage class or storage class property setting for model data category
setDataDefaultSet default storage class and storage class property values for model data category

Root-Level Inport and Outport Configuration

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

Parameter Configuration

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

Signal, State, and Data Store Configuration

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

Coder Dictionary Configuration

getDataDefaultGet default code settings for data category
setDataDefaultSet default code settings for data category
getFunctionDefaultGet default function customization template or memory section for model functions category
setFunctionDefaultSet default function customization template and memory section for model functions category

Tools

Code Mappings EditorAssociate model elements with code definitions

Topics

Configuration Fundamentals

Data Configuration

Function Configuration

Related Information