Technical data
2 
Working with the Target Language
2-2
Why Use the Target Language Compiler?
If you simply need to produce ANSI C code from a Simulink model, you do not 
need to use the Target Language Compiler. If you need to customize the output 
of Real-Time Workshop, the Target Language Compiler is the mechanism that 
you would use. Some uses of the Target Language Compiler are:
• You need to change the way code is generated for a particular Simulink 
block.
• You need to inline S-functions in your model.
• You need to modify the way code is generated in a global sense.
• You need to perform a large scale customization of the generated code.
For example, you need to output the code in a language other than C.
To produce customized output using the Target Language Compiler, you need 
to understand the structure of the 
model.rtw file and how to modify target files 
to produce the desired output. This chapter first introduces the 
model.rtw file 
and then describes the target language directives and their associated 
constructs. You will use the TLC directives and constructs to modify existing 
target files or create new ones from scratch, depending on your needs. Chapter 
3 explains the details of writing target files.










