Target Language Compiler    

Generating Auxiliary Files for Batch FTP

Objective: One application that could use an auxiliary file is automating the process of downloading source files (e.g., model.c, model.h, model.rtw, model_prm.h, model_reg.h, model.mk) to an external target. Such cases arise when the compiler resides on the machine. For example, LynxOS and QNX are UNIX-based systems that allow you to run a compiler under the RTOS where the real-time executable will run.

The files for this exercise are in the tlctutorial/addinfo directory of the TLC examples directory.

Exercise

  1. Copy the file grt.tlc (in matlabroot/rtw/c/grt/grt.tlc) to your current working directory.
  2. Add one line to include ftpdownload.tlc in grt.tlc.
  3. Copy the ftp_assign.tlc file to ftpdownload.tlc into the same directory.

This exercise only requires you to add the ability for TLC to extract the model name and place it in the file that is generated. The information required can be found in the first few lines of the model.rtw file.

  1. Modify the ftpdownload.tlc file so that it extracts the model name and outputs the appropriate filenames to a file called download along with the ftp commands.
  2. Open a model (any of the .mdl files used thus far) and generate code for it using the modified grt.tlc file that you have just created. Look at the file download to see if everything has proceeded okay.

 "Hello World" Example with model.rtw File Generating Code for Models with States