Why do I receive a warning when I use FIND_SYSTEM in the model's PreLoadFcn callback in Simulink 6.1 (R14SP1)?
3 views (last 30 days)
Show older comments
I use the FIND_SYSTEM function in the PreLoadFcn callback for one of my Simulink models. When I open the model, Simulink displays the following warning:
Warning: Attempt to load model file 'model' recursively.
Accepted Answer
MathWorks Support Team
on 8 Jan 2010
This change has been incorporated into the documentation in Release 2009b (R2009b). For previous releases, read below for any additional information:
By default, the FIND_SYSTEM function attempts to load any partially loaded models. When the PreLoadFcn callback invokes FIND_SYSTEM, FIND_SYSTEM tries to load the calling model, causing the recursion warning.
To prevent this warning, disable the model loading property of FIND_SYSTEM by turning off the 'LoadFullyIfNeeded' property. To do this, include 'LoadFullyIfNeeded' and 'off' as the first two arguments of the call to FIND_SYSTEM as shown below:
find_system(gcs,'LoadFullyIfNeeded','off','PropertyName','PropertyValue')
0 Comments
More Answers (0)
See Also
Categories
Find more on Programmatic Model Editing 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!