Custom Memory section for atomic subsystem in custom library

6 ビュー (過去 30 日間)
Vijay Kumar
Vijay Kumar 2024 年 8 月 19 日
編集済み: Vijay Kumar 2024 年 8 月 20 日
I have created a custom library .Inside that I define one atomic subsystem.Iuse this library in my model. While generating autocode that atomic subsystem is defined as seperate function at top above my code sec memory.
I searched many articles I found out one answer, select function packaging as reusable and change the memory section section initiatize to from model.
But this option is not visible for atomic subsytem used in library.

回答 (1 件)

Shubham
Shubham 2024 年 8 月 20 日
Hi Vijay,
When working with custom libraries and atomic subsystems in tools like Simulink, the ability to control function packaging and memory section initialization can be crucial for generating efficient and organized code. You can try following methods:
  1. Ensure Correct Library Configuration: Make sure that your custom library is correctly configured. Sometimes, settings in the library itself can affect how subsystems behave when used in a model.
  2. Check Subsystem Properties: Open the properties of the atomic subsystem within your library. Ensure that the "Treat as atomic unit" option is selected. This option is necessary for the subsystem to be treated as a separate function during code generation.
  3. Set Function Packaging: Although you mentioned that the option is not visible, ensure that you are looking at the right settings. In Simulink, function packaging options can usually be found under the "Code Generation" tab of the subsystem's properties. Refer to this documentation: https://in.mathworks.com/help/ecoder/ug/configure-subsystem-function-interface.html
  4. Model Configuration Parameters: Go to the model's configuration parameters (Ctrl+E in Simulink) and navigate to the "Code Generation" section. Under "Subsystem Parameters," look for options related to function packaging and memory section settings. You might need to adjust these settings globally if they are not available at the subsystem level.
  1 件のコメント
Vijay Kumar
Vijay Kumar 2024 年 8 月 20 日
編集済み: Vijay Kumar 2024 年 8 月 20 日
I have checked all this step but not working my point is.
Is it possible to make the function definition comes under code memory section while its is declared as atomic subsytem inside on custom library block.
For example as I said early, I defined one subsystem as atomic in my custom library and I used that block in my model. Respective function definition for that atomic subsytem is present at top (not in the code memory section) and that is called in main function wherever I used that library block.
Here how I make that definition under code memory section.
One more point I need to add the memory section for that main model is updated from autosar.

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

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by