Clear Filters
Clear Filters

How can I customize the function prototype of the "step" routine (modelname_step()) in the generated code in MATLAB R2012b?

22 views (last 30 days)
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?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 24 May 2024
Edited: MathWorks Support Team on 24 May 2024
"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.

More Answers (0)

Categories

Find more on Model References in Help Center and File Exchange

Tags

No tags entered yet.

Products


Release

R2012b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!