Unable to use "compile" command in RTW hooks for a model referencing Protected Model

7 次查看(过去 30 天)
Hi,
We have a custom target file for Simulink Coder where, we have a "before_make hook" to collect model data (like Datatype and Dimensions of signals and parameters).
We tried to use "model([],[],[],'compile')" command to get Datatype and Dimension information, this was working for models with normal referenced models but,
When a Top Level Model was referencing a Protected Model(with 'use generated code' enabled), putting the model in compile mode from 'before_make hook' throws the following error: (When I tried to put the model in compile mode from MATLAB command promt, I was not seeing the below error).
- Unable to update models referenced by '<ModelName>'.
- Detected recursive call to slbuild, which might indicate invalid simultaneous model builds. If only one model build was in progress, and if you previously used dbquit while in the MATLAB debugger or pressed Ctrl-C during the build process, please restart the model build.
Additional info:
I tried to put the model in compile mode from 'before_tlc hook'. It failed with the same error in the first instance. I ran the compile command again, it succeeded in the second instance but, the final model build fails with error:
Error: Simulink Coder Error: Error occurred during call from TLC to coder.internal.wrapGenRTWTYPESDOTH

回答(1 个)

Venkat Siddarth
Venkat Siddarth 2023-4-6
From the first error message,it appears that the custom target file is not supporting the model references.This can be fixed by configuring the target file to support model referencing.And I think this solution could potentially resolve the second issue as well.
Check out the following documentation,to learn more about it:
Thanks and Regards
Venkat Siddarth V
  2 个评论
Srikanth
Srikanth 2023-4-13
Thanks for your reply!
We have declared Model Referencing Compliance in our custom target file to support model referencing. The issue we have is not with referencing models, issue here is with referencing protected model and then moving the top-level model to compile mode using the below command
model([],[],[],'compile')
Please let us know if you have any suggestions to fix the issue with referencing protected model with compile command.
Srikanth
Srikanth 2023-5-3
I wanted to check if you had got a chance to look at my response. Please let us know if you have any suggestions.
Thanks in advance!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by