Technical data
1
Using the Target Language Compiler with Real-Time Workshop
1-8
To use the Target Language Compiler on small.rtw to generate all associated
RTW code, enter:
tlc –r small.rtw MATLAB/rtw/c/grt/grt.tlc –IMATLAB/rtw/c/tlc
Note: To use the Target Language Compiler and its associated files, you must
know where MATLAB is installed on your system. MATLAB provides a
command that returns this information. Whenever you see the directory
MATLAB in this manual, you should replace it with the path returned by the
matlabroot command. For example, if matlabroot returns:
matlabroot
ans =
/usr/apps/matlab
you would use the command:
tlc –r small.rtw /usr/apps/matlab/rtw/c/grt/grt.tlc
–I/usr/apps/matlab/rtw/c/tlc
The Target Language Compiler processes small.rtw using the system target
file,
grt.tlc, along with other system target files to generate the RTW code.
The generated output consists of the files:
small.h, small.prm, small.c, and
small.reg.
File Purpose
small.c
Source file implementing the algorithms defined by
your model.
small.h Header file containing structure declarations. This file
is included by
small.c, small.prm, and small.reg.
small.prm Include file containing the default parameters and
global data declarations. This file is included once at
the top of
small.c.
small.reg Include file containing the model registration function
and other initialization routines. This file is included
once at the bottom of
small.c.