Target Language Compiler    

Configuring TLC

You can configure TLC from the RTW Options dialog box or from the TLC command line, which is also accessible from the RTW Options dialog box. To use the RTW Options dialog box, select Tools -> Real-Time Workshop -> Options from the Simulink menu. Alternatively, you can select Simulation -> Simulation Parameters and then select the Real-Time Workshop tab from the resulting dialog box.

From the Category drop-down list, select TLC Debugging. This provides options for configuring the build process, including activating the TLC debugger and an option to retain the RTW file. This is covered in more detail in Debugging TLC Files.

Another way of configuring the TLC code generation process is by using the -a flag on the TLC command line. Using -amyVar=1 on the command line is equivalent to saying

in your target file. You can repeat the -a parameter, which also can be specified in the System Target File field in the Target Configuration section of the Real-Time Workshop dialog box.

For an example of how this process works, consider the following TLC code fragment

If you specify -amyConfigVariable=1 in the command line, code fragment 1 is generated; otherwise code fragment 2 is generated. The if block starting with

serves to set the default value of myConfigVariable to 0, so that TLC does not error out if you forget to add -amyConfigVariable to the command line.


  Invoking Code Generation Code Generation Concepts