coder.mapping.api.CodeMapping
说明
代码映射对象和相关函数能够为 Simulink® 模型的数据配置 C 代码生成。对于模型数据元素,代码映射将数据元素与由存储类和存储类属性组成的配置相关联。通过为整个模型中的数据元素类别指定默认配置,减少为 C 代码生成而准备模型的工作量。通过单独配置数据元素来覆盖默认配置。对于较小的模型,您可以选择单独配置每个数据元素。
创建对象
当您从 Simulink 编辑器的 App 选项卡中选择一个代码生成 App 时,例如 Simulink Coder 或 Embedded Coder,如果代码映射尚不存在,该 App 会创建一个 coder.mapping.api.CodeMapping
对象。该 App 基于存储在模型活动配置集对象中的代码自定义设置来创建代码映射。配置集对象可以为数据和函数指定内存段。
通过调用函数 coder.mapping.utils.create
以编程方式创建 coder.mapping.api.CodeMapping
对象。
对象函数
addSignal | Add block output signal to model code mappings |
coder.mapping.api.get | Get code mappings for model |
coder.mapping.utils.create | Create code mappings object for configuring data and function interface for C and C++ code generation |
find | Get model elements for the category of model code mappings |
getDataDefault | Get default storage class or storage class property setting for model data category |
getDataStore | Get code and calibration configuration from code mappings for local or shared local data store |
getInport | Get code and calibration configuration from code mappings for root-level inport |
getModelParameter | Get code and calibration configuration from code mappings for model parameters |
getOutport | Get code and calibration configuration from code mappings for root-level outport |
getSignal | Get code and calibration configuration from code mappings for block output signal |
getState | Get code and calibration configuration from code mappings for block state |
removeSignal | Remove block output signal from model code mappings |
setDataDefault | Set default storage class and storage class property values for model data category |
setDataStore | Configure local or shared local data store for code and calibration file (a2l) generation |
setInport | Configure root-level inports for code and calibration file (a2l) generation |
setModelParameter | Configure model parameter for code and calibration file (a2l) generation |
setOutport | Configure root-level outport for code and calibration file (a2l) generation |
setSignal | Configure block signal data for code and calibration file (a2l) generation |
setState | Configure block states for code and calibration file (a2l) generation |
示例
版本历史记录
在 R2020b 中推出另请参阅
coder.mapping.api.get
| coder.mapping.utils.create
| coder.mapping.api.CoderDictionary
| coder.mapping.api.CodeMappingCPP
(Embedded Coder)
主题
- C Data Code Interface Configuration for Model Interface Elements
- Programmatically Configure C++ Interface (Embedded Coder)
- Service Interfaces (Embedded Coder)