I need help regarding code generation from level-2 c mex s-function. I have written an s-function c-file and a TLC file for code generation.
Here is my TLC file:
some function prototype code;
Code generation works fine. It generates two functions: Init and Step.
I want to add some custom code lines in Init function. How do I do that? Where do I add those lines in TLC code? Which %<LibCache*******(buffer)> method do I use?
NOTE:I have multiple instances of this s-function block in my model and I want to put this custom code just once in Init function. At the moment I put these custom code lines via Model Congicuration Parameters->Code Generation->Custom Code->Insert custom C code in generated:->Initialize function
I hope my question is clear. Amy help is greatly appreciated.