User`s guide
14 Real-Time Workshop Ada Coder
14-12
Configuring the Template Makefile
Template makefiles specify the compiler, link, and make directives native to
the target computer’s operating system and compiler you are using. Two
examples of template makefiles are provided in the directory
matlab/rtw/ada/gnat.Filegnat_sim.tmf isthetemplatemakefilethatbuilds
that real-time Ada simulation program. The automatic build process expands
the macros defined at the top of the
.tmf file to create the call to gnatmake.
gnatmake then compiles and links the program.
There are two ways to make permanent changes to the template makefile if you
need to make modifications either to target a different Ada95 compiler or to
make minor adjustments to the gnat make directive:
• Copythetemplatemakefileintothedirectorywherethemodelislocated
•Copythetemplatemakefiletoauniquenamein
matlab/rtw/ada/gnat and
make modifications to the new file.
Data Logging
You can use the Ada real-time simulation target (rt_ada_sim)toperformthe
same data logging as a Simulink simulation. To enable MAT-file logging, select
the
MAT-file logging check box in the Code Generation Options dialog box.
When this option is selected, the Ada program executes for the duration
specified by the
Stop time fieldontheSolverpageoftheSimulation
Parameters
dialog box.
When the Ada Coder finishes its run, a
model.mat file is created that contains
all workspace variables that would have been created by running a Simulink
simulation. The names of these workspace variables are the same as the names
that would have been created by Simulink, except that an
rt_ prefix is
attached. See Chapter 5, “Data Logging and Signal Monitoring” for more
information about data logging.
Note If you do not select MAT-file logging, the stop time is ignored and the
Ada program runs without stopping.