生成代码接口
使用 ASAP2 和 C API 接口调节参数和测量信号数据,并查看生成的代码元数据
一些应用程序必须在生成的代码和外部应用程序代码之间交换数据。请使用 ASAP2 和 CDF 接口在开发计算机和目标计算机之间建立通信信道,导出一个包含内部 ECU 变量描述格式的 ASAP2 文件,或导出一个标定数据格式 (CDF) 文件,其中包含机读格式的参数信息。使用 C API 在生成的代码和外部代码之间交换数据。
要获得有关生成代码的元数据,请使用代码描述符编程接口。
Sample Target Environment Service Implementations of Data Communication Methods 显示目标环境服务如何实现三种类型的数据通信方法的示例:直接访问、执行期外和执行期间。
工具
生成标定文件 | Generate ASAP2 and CDF files (自 R2021b 起) |
类
函数
主题
ASAP2 和 CDF 接口
- Parameter Data Types in the Generated Code
Optimize the generated code and generate code for specific processors by controlling the data types that store parameter data in computer memory. - 在生成的代码中创建可调标定参数
在生成的代码中创建可在快速原型和标定过程中访问的可调参数数据。 - Calibrate Generated Code and Monitor Signals
Generate XCP external mode target application and ASAP2 file that describes the XCP server configuration. - 生成 ASAP2 和 CDF 标定文件
分别根据 ASAM MCD-2 MC 和 ASAM AE CDF 标准生成 ASAP2 和 CDF 文件。 - Customize Generated ASAP2 File
Customize the ASAP2 file generated from a Simulink® model. - Create and Add Custom Data Elements
Add custom data elements to an ASAP2 file. - Customize Using Base Files
Use the base class and files to customize the ASAP2 fields Simulink model. - Configure Model Data Elements for ASAP2 File Generation
Set measurement and calibration properties for model data elements.
C API 接口
- 使用 C API 在生成的代码和外部代码之间交换数据
编写基于主机或基于目标的应用程序代码,与生成的模型代码进行交互。 - Use C API to Access Model Parameters
Write application code to interact with model parameters. - Use C API to Access Model Signals and States
Write application code to interact with model signals and states.
代码描述符接口
- Get Code Description of Generated Code
Obtain metadata about the generated code. - Get Generated Type and Name of Inport Structures
Obtain metadata about the inport structures in generated code. - Get Metadata About Service Interface
Obtain metadata about the generated service interface by using the code descriptor programming interface.