Configure embedded coder generated code to exclude model_initialize() entry function

6 Ansichten (letzte 30 Tage)
How do you setup a simulink model to exclude model_initialize() entry point function when generating code using embedded coder?

Antworten (1)

Jack
Jack am 26 Mär. 2023
In Simulink, the model_initialize() function is used to initialize the model states and other variables before simulation. However, in some cases, you may want to exclude this function from the generated code when using Embedded Coder.
To exclude the model_initialize() function from the generated code, you can use the following steps:
  1. Open your Simulink model in Simulink.
  2. Select "Model Configuration Parameters" from the "Simulation" menu.
  3. In the "Configuration Parameters" dialog box, select the "Code Generation" tab.
  4. Under "Interface", select "Code replacements".
  5. In the "Code replacements" table, locate the row that corresponds to the model_initialize() function.
  6. In the "Replacement function" column, enter the name of a custom function that you want to use in place of model_initialize(). If you want to exclude this function entirely, you can leave this field blank.
  7. If you entered the name of a custom function in step 6, specify the function prototype in the "Prototype" column. If you left the "Replacement function" field blank, you can ignore this step.
  8. Click "OK" to close the dialog box and save the configuration changes.
  9. Generate code using Embedded Coder as you normally would. The generated code will now exclude the model_initialize() function.
By following these steps, you can configure your Simulink model to exclude the model_initialize() function from the generated code when using Embedded Coder.
  1 Kommentar
Evans Ejegi
Evans Ejegi am 26 Mär. 2023
Hi Jack,
Thanks for your response. Going through the steps you stated lands me in this dialog box:
Not sure how to procced from here.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Deployment, Integration, and Supported Hardware finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by