0

TO generate/build c++ code from Simulink diagrams one could use Embedded/Simulink Coder toolbox to generate C++ code from the give diagrams. Depending on which toolbox is used, generated code will be saved in a folder including part of "System target file" which is grt.tlc for Simulink Coder and ert.tlc for Embedded Coder Toolbox.

My question: is there any way to write a command to know which "System target file" is applied for the simulation's configuration?

In my code I need to know which target file is set up for deciding which method comes next?

Royeh
  • 433
  • 5
  • 21
  • Not sure what you want. Do you want to read the target from a opened model or from a folder of generated code? – Daniel Aug 11 '15 at 09:20
  • Because Simulink Coder generates a folder including `_grt` and Embedded Coder generated a folder including `_ert` then I just want to know the type of target file and then will move the whole generated folder to another derive to run the next step. Because for each example the target file differs then I have to know it. – Royeh Aug 11 '15 at 09:49

1 Answers1

1

You can get the "System target file" using

get_param(gcs, 'SystemTargetFile')

You can also change build directory several ways. See the answer Save generated code in a special folder in "rtwbuild" which explains ways of changing code generation directory. This changes only the top level directory. You will still see _grt or _ert directory inside this. But you can create a new directory before a call to rtwbuild and then you will have only one set of code generation files inside that.

Community
  • 1
  • 1
Navan
  • 4,407
  • 1
  • 24
  • 26