Protected model fails to build

조회 수: 9 (최근 30일)
Robrecht
Robrecht 2024년 5월 29일
답변: Githin George 2024년 10월 4일
Hello,
I have created a simulink model which implements an inlined s-function which uses a .tlc file and external .c and.h files. I have configured everything correctly as the simulation is working, and when I perform a compile this also goes without issues.
However, when a try to save te model as a protected model the compilation fails as it cannot fild the external .c and .h files. Event hough i have configured it correctly under "custom code" in the model settings.
I would expect that saving it as a protected model would also use these settings, but it does not seem to be the case. What am i dowing wrong?
  댓글 수: 3
Robrecht
Robrecht 2024년 5월 29일
Where do I set the compiled code options? Do wou mean setting content type to binaries as in the screenshot below?
I already have done this without succes.
Sarthak
Sarthak 2024년 5월 30일
Even I am not able to find this option. I shared the documentaiton hoping it might be there but I just checked its not. Not sure how to go about this then.

댓글을 달려면 로그인하십시오.

답변 (1개)

Githin George
Githin George 2024년 10월 4일
Hello Robrecht,
I have a created an example model that implements a wrapper inlined S-Function as described in the documentation below:
By using the “LibAddToModelSources” function in the TLC file directly, I was able to successfully compile and build the model without adding the sources to the “Custom Code” section in the Configuration Parameters. For more information refer to the function documentation for “LibAddToModelSources” here:
Additionally, the following documentation describes the limitations of specifying complete source file path for your C code:
I was able to generate the Protected Model, and successful extract the contents of “model1_protected.mlproj” and use the Protected Model. I used MATLAB R2024b to create the model and I am attaching the zip file here.The above workflows assumes that you are using wrapper inline S-Functions and I hope this helps resolves your issue.

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by