I have some level 2 sfunctions in my system to wrap my C/C++ functions. All of these functions are fixed and I don't change them. Is it possible to avoid code generation of these function each time that I build an application for the xpctarget?
2 views (last 30 days)
Show older comments
Hello,
I am trying to compile and a build a Simulink system as an xpctarget application. My system has some level-2 Sfunctions that I use to wrap some of my C/C++ functions. One of these functions is huge and each time that I change my system and try to build the application it takes a long time to do code generation for that sfunction. (compilationa and linking are pretty fast since I use static libraries of my functions.)
Is there a possibility that once the code is generated for the sfunction, the next time somehow avoid code generation for that sfunction. Or, I separately generate code for the sfunction once and each time just using the generated code.
Thanks for your help,
Reza
0 Comments
Answers (3)
Kaustubha Govind
on 2 Nov 2012
I think the only way to bypass code-generation for one part of the model is to using a Model Reference block. Try putting your S-function is a separate model and reference that model from the main model. I think if the generated code for the referenced model already exists, Simulink Coder won't attempt to generate code again.
0 Comments
Alireza
on 3 Nov 2012
1 Comment
Kaustubha Govind
on 5 Nov 2012
Have you already written a TLC file for your S-function? From the error message, it looks like you need to do so. Please see S-Function Inlining.
See Also
Categories
Find more on Simulink Coder in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!