课程详细信息
本课程为期一天,介绍多种 Simulink® 模型集成 C 代码方法。介绍的内容包括 C Caller 和 C Function 模块、将外部 C 函数封装到 Simulink 的遗留代码工具以及手动编写的 C MEX S functions。本课程面向中高级 Simulink 用户。
Day 1 of 1
Integrating External C Code Using Simulink Blocks
Objective: Integrate C code into Simulink models using the C Caller and C Function blocks.
- Integrating algorithmic C code
- Integrating C code with custom data types
- Integrating code with states
- Sharing custom C code blocks
Creating S-Functions from Legacy Code
Objective: Integrate C code into a Simulink model using automated tools.
- Calling external C functions with Legacy Code Tool
- Handling states
- Sharing compiled S-functions
Writing Wrapper S-Functions
Objective: Integrate C code into a Simulink model by manually writing C MEX S-functions.
- Writing C MEX S-functions
- Calling external code from C MEX S-functions
- Work vectors
- Debugging C MEX S-functions
- Multirate C MEX S-functions
Deploying Integrated C Code
Objective: Explore the procedures and limitations for automatically generating code with Simulink Coder™.
- Generating code from C Caller and C Function blocks
- Generating code from C MEX S-functions
- Function inlining
- Integrating target-specific code
C Code Integration Methods Review
Objective: Review code integration methods and discuss the pros and cons of each.
- Review of all methods of code integration
- How to choose a code integration method