- 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.
- 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.
- 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
- 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.
Custom Memory section for atomic subsystem in custom library
5 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Shubham
on 20 Aug 2024
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:
See Also
Categories
Find more on Subsystems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!