应用程序和组件接口
应用程序和组件是代码单元,由代码生成器从顶层模型中生成。部署要在目标执行环境中使用的应用程序和组件。为了使代码生成器生成能够与目标环境服务交互的 C 或 C++ 代码,您必须通过使用以下各项的组合来使代码生成器了解服务接口要求:
顶层模型中的模型元素
在 Embedded Coder 字典中定义的代码接口配置(仅限 C 代码)
将模型元素与代码接口配置中定义的接口相关联的代码映射
生成的应用程序和组件代码通过这些生成的代码接口与目标环境服务进行交互:
目标软件(如调度器)可以调用的入口函数
对目标软件的函数调用,例如平台服务函数
主题
- Model Code Interfaces
Learn about typical ways to represent code interfaces in top models.
- Configure Code Interfaces for Code Generation
Choose between options for configuring code interfaces for application and component models.
- Periodic and Aperiodic Function Interfaces
Generate callable entry-point functions for the algorithm represented by a top model.
- Startup, Reset, and Shutdown Function Interfaces
Generate callable entry-point functions for startup, reset, and shutdown processing represented by a top model.
- Data Interfaces
If you are deploying a top model as an application or generating C++ code, configure the model to use a data code interface.
- Service Interfaces
Generate C service interface code for components that interact with target environment resources.
- Message Communication Interfaces
Design a component that communicates with middleware by using triggered messages.
- Client-Server Communication Interfaces
Design a component that uses client-server communication.
- Device Driver I/O Interfaces
Design a component that reads input from or writers output to hardware devices.
- Multi-Instantiation
Design a component or subcomponent with the goal of using multiple instances within the context of an application.