Protected model fails to build
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
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
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.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!