
                                 ------------------
                                 - SPECIFICATIONS -
                                 ------------------


The main characteristics of "Simulink Target for RT-Linux" are: 

  - Monitoring of the real-time experiment using the Simulink's external mode mechanism. 
    The target machine (RTLinux) and the host  machine (Simulink) are connected through a 
    TCP/IP connection. Signal values are uploaded and displayed on the Scope blocks. 

  - A check is performed to ensure that the target platform can handle the requested 
    "Fixed step size" specified in the block diagram. If the "Fixed step size" is too 
    small the application terminates and an error message is displayed. 
 
  - MATLAB data logging is supported by creating a MAT-file when the session terminates. 
    The "To File" blocks are not supported, though. 

  - "Simulink Target for RT-Linux" supports SingleTasking and MultiTasking mode. 

  - A watchdog makes sure that overrun conditions do not occur.

  - A Discarding Algorithm has been implemented to improve real-time monitoring in Local Area
    Networks. It measures the available bandwidth and discards signal points that do not fit
    within this bandwidth.

  - The last update of "Simulink Target for RT-Linux" has been developed using Red Hat 6.2 with
    the Linux kernel version 2.4.4 and RTLinux V 3.1.

-------------------------------------------------------------------------------------------------


                                 ----------------
                                 - INSTALLATION -
                                 ----------------

This version of "Simulink Target for RT-Linux" is to be used with MATLAB Version 6.5 

The installation of this application is straight forward. Just follow the subsequent steps:

 1 - Unzip the file STRTL_M65_V1.2.zip (most surely you may have done this already).

 2 - In the Windows machine extract the file rtlinux.zip. 
     You should have now a folder called 'rtlinux'. Copy this folder somewhere within the Matlab
         folder structure, for instance \(MATLAB_ROOT)\rtw\c\rtlinux. 
     Add this path to the Matlab search path. Next time you open Matlab "Simulink Target for 
         RT-Linux" should appear in the list of targets in the "System Target File Browser". 
         In addition, one input block and one output block for the data acquisition card should 
         now be available in the "Simulink Library Browser". 

 3 - In the Linux machine uncompress and extract the file STRTL_M65.tar.gz 
         tar -zxvf STRTL_M65.tar.gz
     You should have now a folder called STRTL_M5.1 with some subfolders containing the RTW 
         source files. 
     You can copy this subfolder anywhere as long as the location matches with the definition of 
         the macro MATLAB_ROOT of the template makefile rtlinux.tmf. By default this macro 
         points at /STRTL_M6.1

 4 - Unless you do not have the command 'rtl-config', that should be it. To check if you have 
         this command just execute it: rtl-config. If noting is displayed you will have to do the 
         following. Specify the macros RTL_INCLUDES and RTL_OPTS in rtlinux.tmf. These macros 
         determine the folders and preprocessor macros needed to compile a module for RTLinux, 
         and will depend on the version and how you have configured Linux and RTlinux. To do so,
         copy the output of the command 'rtl-config --cflags' to RTL_OPT and the output of 
         'rtl-config --rtinclude' to RTL_INCLUDES. Alternatively, you can run any RTLinux module,
         for instance, go to /usr/rtlinux/examples/hello and run 'make'. Copy the included 
         directories (-I/usr...) to RTL_INCLUDES and the preprocessor macros to RTL_OPTS.

 
Note: ext_comm_rt.c is a slightly modified version of the original ext_comm.c. 
      ext_comm_rt.dll is the MEX-file used for external mode communication. It should 
      automatically be selected on the "External Mode Control panel" -> "Target Interface".


That's all you need to do. Create the block diagram and copy the generated source files into 
the Linux machine. From there just type 'make -f model.mk' to compile and load into the kernel 
all the required modules. With a bit of luck there should not be any errors and the model 
should now be running in real-time (fingers crossed). Otherwise just contact me on:

r.murillogarcia@gcal.ac.uk

-------------------------------------------------------------------------------------------------


                                   -------------------
                                   - USER PARAMETERS - 
                                   -------------------


ST-RTL user-specified parameters have been added to the system target file rtlinux.tlc and 
thus made accessible through Simulation -> Parameters -> Real Time Workshop -> Options. 
These parameters are listed below and are only enable is External Mode is selected. 


     Port Number, port number used for the TCP/IP connection with the host. The default value 
                  is 17725 and the valid range from 256 to 65535, i. e. the ephemeral ports 
                  not reserved by the system.

     Verbose, macro to control whether messages are displayed on the screen. If undefined the 
                  messages are omitted. This macro is defined by default.

     Wait for Start Message, controls the behaviour of the target application upon 
                  initialization. When disabled (default), the model starts after the 
                  handshaking is complete. Otherwise, the application waits for the host 
                  machine to start the model.

     Final Time, the final time must be a positive, real value or inf to run the model 
                  infinitely.  

     Blocking Wait for A/D Conversions, if enabled, the busy flag of the data acquisition 
                   card is polled. Otherwise, usleep()  is   implemented.

     Real-Time Monitoring, if enabled, an algorithm is executed in order to improve real-time 
                   mointoring. It will only work in isolated LAN. Disable it if you intend 
                   to connect to the RT-Linux workstation using a WAN. The algorithm consists 
                   of transmitting only the data that fits within the availabel network 
                   bandwidth. Therefore, data will be discarded (dropped). 

-------------------------------------------------------------------------------------------------


                                   -----------------
                                   - MODIFICATIONS -
                                   -----------------


  > 21 April 2003: STRTL_M65.1.2  < 
  
  - Release this version of ST-RTL for MATLAB R13. 


  ------------------
  -- FUTURE WORK ---
  ------------------
  
  - Make kernel errors available to uesr space and host machine.


-------------------------------------------------------------------------------------------------


                                  -----------
                                  - LICENSE -
                                  -----------

License and terms of usage for "Simulink Target for RT-Linux" 

   "Simulink Target for RT-Linux" is semi-free software. You can redistribute it and/or modify 
   it under the terms of the GNU General Public License Version 2 as published by the Free 
   Software Foundation (see file COPYING.TXT included) for non-profit purposes (educational, 
   scientificand personal purposes). You may not use it for commercial purposes. You may not sell it, 
   and you may not sell or commercially exploit the results you obtained by using it.

   This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
   without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
   See the GNU General Public License for more details.

   You should have received a copy of the GNU General Public License along with this program;
   if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

-------------------------------------------------------------------------------------------------


Author:

      Raul Murillo Garcia
      School of Engineering, Science and Design
      Glasgow Caledonian University
      Glasgow G4 0BA
      Scotland, UK

      r.murillogarcia@gcal.ac.uk	

