フィルターのクリア

can some one explain me how to pass /give argument to add function instead of void value in simulink function

2 ビュー (過去 30 日間)
can some one explain me how to pass /give argument to add function instead of void value in simulink function, How to pass value to add function instead of void value?
  1 件のコメント
Ayush Singh
Ayush Singh 2024 年 5 月 21 日
Let me know that do you want to directly change the generated C code or you are okay with modifications in the model itsef, based on your reply I will suggest you the approach.
As a suggestion I would recommend you to not make modifications directly to C code due to the risk of those changes being overwritten by the code generation process.

サインインしてコメントする。

回答 (1 件)

Suman
Suman 2024 年 6 月 18 日
It is not recommended to make changes to the generated code or the default function signatures unless you have a good understanding of the Simulink code generation process. However, if you wish to pass arguments to the step function in the generated code, you can do so by configuring the function in the Code Mappings Editor.
1) Open the Code Mappings editor from the C Code tab for Embedded Coder.
2) Go to the Functions tab. Here you can see the initialize, step and terminate function signatures in the Function Preview column. Click on the green refresh symbol in the Functions tab if the step function is not visible.
3) Click on the function signature in the Function Preview column to modify it.
4) In the dialog box that opens, select the Configure arguments for Step function prototype
5) Click on Get default button.
6) Modify the function signature as required and click Validate.
You can refer to these documentation to learn more about tweaking the generated code:

カテゴリ

Help Center および File ExchangeSources についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by