Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Windows Target   

Testing the Installation

About Installation Testing

Real-Time Widows Target includes several demo models. You can use the demo models to test your installation. Demo models simplify testing of your installation since they are configured with settings that include the correct target, scope settings, sample time, and integration algorithm. To see these demo models, type rtwtdemo in the MATLAB Command Window.

Once you have completed the installation of the Real-Time Windows Target software and kernel, we recommend a quick test by running the model rtvdp.mdl. If you change your installation, we also recommend doing this test as a quick check to confirm that the Real-Time Windows Target software is still working. To open the demo model, type rtvdp in the MATLAB Command Window, or launch MATLAB Online Help and choose Real-Time Windows Target > Demos > Real-Time Van der Pol Simulation.

Running the Model rtvdp.mdl

The model rtvdp.mdl does not have any I/O blocks, so that you can run this model regardless of the I/O boards in your computer. Running this model will test the installation by running Real-Time Workshop code generation software, Real-Time Windows Target software, and the Real-Time Windows Target kernel.

After you have installed the Real-Time Windows Target kernel, you can test the entire installation by building and running a real-time application. The Real-Time Windows Target software includes the model rtvdp.mdl, which already has the correct Real-Time Workshop options selected for you:

  1. In the MATLAB Command Window, type

    rtvdp
    

    The Simulink model rtvdp.mdl window opens.

  2. From the Tools menu, choose Real-Time Workshop > Build Model.

    The MATLAB Command Window displays the following messages:

    ### Starting Real-Time Workshop build for model: rtvdp
    ### Invoking Target Language Compiler on rtvdp.rtw
    . . .
    ### Compiling rtvdp.c 
    . . .
    ### Created Real-Time Windows Target module rtvdp.rwd. 
    ### Successful completion of Real-Time Workshop build procedure 
    for model: rtvdp
    
  3. From the Simulation menu, click External, and then click Connect to target.

    The MATLAB Command Window displays the following message:

    Model rtvdp loaded
    
  4. From Simulation menu, click Start Real-Time Code.

    The Scope window displays the output signals. If your Scope window looks like the next figure, you have successfully installed the Real-Time Windows Target software and have run a real-time application.

  5. From Simulation menu, click Stop Real-Time Code.

    The real-time application stops running, and the Scope window stops displaying the output signals.

Displaying Status Information

The Real-Time Windows Target software provides the command rtwho for displaying the kernel version number, followed by performance, timeslice, and other information. To see this information, in the MATLAB Command Window type

rtwho

The command displays several lines of information in the MATLAB Command Window. Some possible lines and their interpretations are:

MATLAB performance = 100.0%

This message indicates that the MATLAB environment and other non-real-time applications (for example, a word processor) are able to run at 100% performance because no real-time applications are currently executing. When a real-time application is executing, the MATLAB performance is at a value below 100%. For example, if the MATLAB performance = 90.0%, then the real-time application is using 10% of the CPU time. We recommend that you select a sample rate so that rtwho returns a MATLAB performance of at least 80%.

Kernel timeslice period = 1 ms

The kernel time slice period is the current frequency of the hardware timer interrupt. One millisecond is the maximum value for models with large sample times (slow sampling rate) or when an application has not been built. This value changes when you select sampling times less than 1 millisecond.

TIMERS:  Number    Period  Running
              1      0.01      Yes

The indicated timer(s) exist on your system with the period and run status shown for each timer.

DRIVERS:           Name    Address   Parameters
         Humusoft AD512      0x300    []
                    ecg          0     []

The indicated device driver(s) are installed on your system at the address and with the parameter(s) shown for each driver.

Detecting Excessive Sample Rates

If your specified sample rate is too fast, the Real-Time Windows Target software detects and reports this during real-time execution. Sampling rates exceeding 10 kHz can be achieved on Pentium computers. Once the model is running, you can issue the rtwho command in the MATLAB Command Window to observe the system performance.

For example, the following lines show that MATLAB performance has decreased because the system is overloaded:

MATLAB performance = 77.1%
Kernel timeslice period = 0.001 ms

We recommend that MATLAB performance not fall below 80%.

Demo Library

The demo library includes models with preset values and dialog boxes. These models include a configuration of examples that use no I/O, A/D only, A/D and D/A in a simple signal processing demo, as well as in a simple control demo. Examples that use I/O blocks require you to configure the Adapter block to match the I/O board installed in your computer. To see these demo models from the MATLAB environment:

  1. Type rtwtdemo in the MATLAB Command Window.

    The Real-Time Windows Target Demos window displays.

  2. From the list, select the demo to open it.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS