How can I customize the function prototype of the "step" routine (modelname_step()) in the generated code in MATLAB R2012b?
11 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2013-7-15
编辑: MathWorks Support Team
2024-5-24
When I generated code from my Simulink model the entry point functions in the generated code appear as "modelname_step()" function, with no arguments.
However, I want to change the name of this entry point function to "modelname_run()". I also want the function prototype to include all of the bus structures that I've defined into and out of the model.
How can I accomplish this?
采纳的回答
MathWorks Support Team
2024-5-24
编辑:MathWorks Support Team
2024-5-24
"model_step()" and is the default name of the step routine in the code generated from a Simulink model. If you use Embedded Coder, you can customize this code interface appearance in the generated code. This means the System Target File should be set to ert.tlc.
Follow the steps below to customize the generated code for this use case:
1. Go to Configuration Parameters -> Code Generation-> Interface.
2. In this pane, go to the section titled “Code Interface” and click on “Configure Model Functions” button to open the “Model Interface” window.
3. Change the Function Specification field to “Model specific C Prototypes”.
4. Hit 'Get Default Configuration'
5. Now configure the names of the “step” function and the arguments of the “step” function to include all relevant input/output structures.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model References 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!