数据和函数配置
为数据和函数配置代码生成,以便于软件集成
要为快速原型生成代码,请为代码生成配置模型数据元素的表示。您可以通过将模型数据元素映射到产品预定义的代码定义(存储类)来对其进行配置。
有关介绍,请参阅模型接口元素的 C 代码生成配置。
对象
coder.mapping.api.CodeMapping | Model data and function interface configuration for C code generation |
coder.mapping.api.CoderDictionary | Query and set the code settings of dictionary defaults in an Embedded Coder dictionary within a Simulink data dictionary |
函数
工具
Code Mappings 编辑器 | Associate model elements with code definitions |
主题
配置基础
- 模型接口元素的 C 代码生成配置
控制生成的 C 代码中模型数据元素的表示。 - Code Definition and Mapping Limitations and Considerations
Restrictions, constraints, and considerations that apply to code definitions and code mappings. - Manage Multiple Code Mappings for a Model
Design models that are platform-neutral and ready to deploy to different run-time environments. - Migration of Model Data Configurations to Code Mappings
How Simulink® migrates code definitions for models created before release R2020b to code mappings and related information to consider.
数据配置
- Choose Data Configuration Approach
Make decisions about the design data used by your model based on your code generation requirements. - Configure Root-Level Inport Blocks for C Code Generation
Set the storage class and other relevant code generation properties for root-level Inport blocks. - Configure Root-Level Outport Blocks for C Code Generation
Set the storage class and other relevant code generation properties for root-level Outport blocks. - Configure Signal Data for C Code Generation
Set the storage class and other relevant code generation properties for signal data. - 为 C 代码生成配置参数
为参数设置存储类和其他相关代码生成属性。 - Configure Block States for C Code Generation
Set the storage class and other relevant code generation properties for block states. - Configure Data Stores for C Code Generation
Set the storage class and other relevant code generation properties for data stores. - 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.
函数配置
- 为模型入口函数配置 C 代码生成
了解生成的 C 入口函数、配置选项以及如何与它们对接。 - Control Data and Function Interface in Generated Code
Control how generated code exchanges data with a calling environment. - Rapid Prototyping Model Functions
Generate rapid prototyping code. - 从顶层模型生成可重入代码
从顶层模型生成可重用的可重入代码。