Compilation error of simulink model, that calls a reference model twice

조회 수: 5 (최근 30일)
Ngoc Anh Nguyen
Ngoc Anh Nguyen 2023년 3월 20일
답변: Harsh 2025년 5월 7일
Hi,
I have one simulink model for Cpp code generation, which is referenced twice in a simulation model. While compiling the latter, I encounter the following issue.
Cannot generate reusable model reference target in the presence of machine parented data, events or exported graphical functions. Consider updating the 'Total number of instances allowed per top model' parameter, in the Model Referencing tab of the Simulation parameters (Configuration) dialog to "one".
Although a hint is given in the error message, after having set the field 'Total number of instances allowed per top model' to "one", the compiler again asks to set it back to "Multiple".
I have been looking around for hints without success, and trying to localize the issue. It somehow links to a matlab function block (in simulink) in the referenced model. Could you please give me hints to resolve the above issue?
Thanks in advance!
Regards,
Anh

답변 (1개)

Harsh
Harsh 2025년 5월 7일
Embedded Coder does not support machine-parented data for code generation. Ther referenced model should also not uses any exported Stateflow graphical functions. Please check your referenced model for these cases. For more information on requirements and limitations of the model reference, please refer to the following documentation - https://www.mathworks.com/help/simulink/ug/model-referencing-limitations.html
1. If your referenced model has machine parented data, you can -
  • Run the "Upgrade Advisor" on your referenced model
  • Manually delete machine parented data symbols from each Stateflow chart and use Data Store Memory instead.
2. If your referenced model exports Stateflow graphical functions, you can -
  • Refactor them into chart-scoped functions
  • Remove the export option for the Stateflow graphical funciton. Please note that removing export will break references in other charts or blocks. Ensure that dependent components are updated accordingly.
Hope this resolves your query !

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by