Avoiding TLC file writing

Hi everybody, I'm trying to run a simulation of a very simply model containing, at top level, a S-function builder block and a subsystem 'tagada' containing a Level-2 M-File S-function 'msfun2'. When I press 'Start Simulation' it stops the procedure because of this error:
The corresponding 'msfun2.tlc' file for the M S-function 'msfun2' in block 'tagada/Level-2 M-file S-Function1' must be located in the current working directory, the M S-function directory 'H:\OASIS_SMS\simulink\work', or the directory 'H:\OASIS_SMS\simulink\work\tlc_c'.
I would like to run a simulation of my model without writing such a TLC file.
Can anyone tell me why does simulink require a TLC file for my Level-2 M-file S-Function .. Even though i'm not intending to generate code for this model ?
How can i avoid writing a TLC file for simulating my model ?
Thank you all!

6 Comments

I wonder what would happen if you put an empty .tlc file in one of those places?
If your model is running in Normal mode, it shouldn't attempt to generate code for your model. Could you see what get_param('modelname', 'SimulationMode') returns?
Thank you Walter and Kaustubha for your answers.
Walter, if i put an empty file 'msfun2.tlc' in the directory of my model, i get the following error message:
Error: File: msfun2.tlc Line: 1 Column: 1 A %implements directive must appear within a block template file and must match the %language and type specified
Kaustubha, models are all in normal mode. I used to generate rtw code for the top level model 'envglobal' but i'm currently testing some new things in the submodel tagada (which msfun2 belongs to) and i'd like to get rid of code generation stuffs in the current step.
>> get_param('tagada', 'SimulationMode')
ans =
normal
>> get_param('envglobal', 'SimulationMode')
ans =
normal
Very strange. I presume there are no model reference blocks inside which the S-function is being used? What about if you pull the s-function block into a fresh model and run simulation?
I do not use model reference blocks at all. The S-function is used in the tagada subsystem which is included into the envglobal model. If I use the s-function m file in a fresh model I can simulate it without having to write a tlc file .. It is exactly what i want to do .. perhaps should i try to restart my model from scratch .. thanks for your help.
did you found any solution, i'm having similar problem

Sign in to comment.

Answers (1)

Kevin
Kevin on 29 Mar 2015
The problem may come from the configuration parameters. Configuration parameter => code generation => check which system target file you have configured. If there is something as "embedded coder" on this page, you will need a TLC file.
You're telling you don't want to generate code for embedded solution, then configure the parameter panel accordingly.
Now I have to look for a solution for this exact problem, but when you actually need to generate code... life can be sad :(

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products

Asked:

on 10 Sep 2012

Answered:

on 29 Mar 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!