From: theo on
Hello people,

I am trying to add code to the model.c file. I am trying to add a bit of code to the model_initialize function. The code somehow doesn't appear. No matter what I have tried.

I am using matlab 2007b and the simulink file that comes with it. I am calling the function LibMdlStartCustomCode. I don't really care atm where it is put in the init funct. As long as it gets there.

This is my code:
%<LibGetModelName()>//for testing purposes
%openfile bufferMdl
//codeexample
%closefile bufferMdl
%<LibMdlStartCustomCode(bufferMdl,"header")>

This is called during the main generation(in TLC file). This is right before the init method is called. The model name gets printed. //codeexample doesn't get printed. I don't get an error message or something. It just won't appear. The method LibSetSourceFileSection allows me to write into the model.c file. But not in the init func.
Does anyone have suggestions how I can fix this?

Thanks in advance