Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

数据和函数配置

为数据和函数配置代码生成,以便于软件集成

要为快速原型生成代码,请为代码生成配置模型数据元素的表示。您可以通过将模型数据元素映射到产品预定义的代码定义(存储类)来对其进行配置。

有关介绍,请参阅模型接口元素的 C 代码生成配置

对象

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

函数

全部展开

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

创建和查找代码映射

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

默认配置

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

根级输入端口和输出端口配置

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

参数配置

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

信号、状态和数据存储配置

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

编码器字典配置

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

工具

Code Mappings 编辑器Associate model elements with code definitions

主题

配置基础

数据配置

函数配置