Protected model fails to build
18 views (last 30 days)
Show older comments
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 Comments
Sarthak
on 30 May 2024
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.
Answers (1)
Githin George
on 4 Oct 2024
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.
0 Comments
See Also
Categories
Find more on Simulink Coder 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!