Combining generated codes from different referenced models works?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I have a simulink model (top system) where there are several different reference models.
When I build the model for the top system, codes for reference model are generated in slprj subfolder.
But When I build the model for the reference model, codes are generated in the current folder not slprj subfolder.
Comparing two source codes, you can find some difference.
What I'm wondering about is that is it possible to get the same result by combining the code separately generated for the reference model.
Let me give a specific example.
Top system has two reference model. Controller and Plant.
I generate code for Controller model and Plant model respectively.
Now I have two code sets for two models.
Controller.h, Controller.c, Controller_private.h, Controller_types.h in Controller_ert_rtw folder
Plant.h, Plant.c, Plant_private.h, Plant_types.h in Plant_ert_rtw folder
But when I generate code for top system, I have these files.
TopSystem.h, TopSystem.c, TopSystem_private.h, TopSystem_types.h,
slprj/Controller.c, slprj/Controller.h, slprj/Controller_private.h, slprj/Controller_types.h
slprj/Plant.c, slprj/Plant.h, slprj/Plant_private.h, slprj/Plant_types.h
Can I get the same result by merging codes for each reference model as I do for the top system?
Is there anyone who have done this?
Thank you.
댓글 수: 1
Suman
2024년 10월 1일
You can refer to this MATLAB answer, https://in.mathworks.com/matlabcentral/answers/334854-how-can-i-connect-2-generated-code-from-2-different-simulink-models as well as this documentation that explain a similar issue, https://in.mathworks.com/help/rtw/ug/combined-models.html
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!