User`s guide
2 Getting Started with the Real-Time Workshop
2-18
a MATLAB MAT-file. You can load this data into MATLAB for analysis. See
“Blocks That Depend on Absolute Time” on page 2-21 for more information.
Inputs to models cannot be saved using the Workspace I/O page. To save
inputs, you can use Scope block and click the
Properties button. Alternatively,
you can use a To Workspace block. See Using Simulink for more information
about saving data to the MATLAB workspace using either of these methods.
Run-Time Interface for Real-Time
Building the real-time program requires a number of source files in addition to
the generated code. These source files contain:
• A main program
• Code to drive execution of the model code
• Code to implement an integration algorithm
• Code to carry out data logging
• Code to create the
SimStruct data structure, which is used to manage
execution of your model
Configuring the Template Makefile
This example uses two different template makefiles: grt_unix.tmf for the
UNIX environment and
grt_vc.tmf, grt_watc.tmf,orgrt_bc.tmf (depending
on which compiler you have selected) for the PC environment. These makefile
templates are automatically processed into makefiles properly configured to
build the program. You can alter the build process by copying the template
makefile to your local directory and modifying it.
These files are located in the
matlab/rtw/c/grt directory. Use the MATLAB
matlabroot command to determine the MATLAB path on your system.
The UNIX Template Makefile
The grt_unix.tmf template specifies cc or GNU’s gcc as the default compiler.
It also specifies the necessary source files, compiler flag, include paths, etc.,
that are required to build the program. You can, in general, use this makefile
template without modification.