Application and Driver Scripts

These examples show the features of Simulink® Real-Time™. Use these scripts as a starting point for writing your own scripts for creating and testing real-time applications.

Examples include general applications examples and driver examples. You can access the general application and driver examples through MATLAB® Help. In the help window, click Real-Time Simulation and Testing > Simulink Real-Time > Examples.

General Examples

The general application examples include models and scripts.

Description

File Name

Real-time parameter tuning and data logging

Parameter Tuning and Data Logging

Freerun display mode of a host scope

Signal Tracing With a Host Scope in Freerun Mode

A software-triggered host scope

Signal Tracing Using Software Triggering

A signal-triggered host scope

Signal Tracing Using Signal Triggering

A scope-triggered host scope

Signal Tracing Using Scope Triggering

Signal tracing with a target scope

Signal Tracing With a Target Scope

Pre- and post-triggering of a host scope

Pre- and Post-Triggering of a Host Scope

Time- and value-equidistant data logging

Time- and Value-Equidistant Data Logging

Logging signal data with the Simulation Data Inspector to a file on the development computer

Data Logging With Simulation Data Inspector (SDI)

Frame signal processing

Frame Signal Processing

Simulink Real-Time software as a real-time spectrum analyzer

Spectrum Analyzer

Creating a custom client application to interface with the target computer

Simple Client Application With the .NET API

Concurrent execution of a model using the Simulink Real-Time profiling tool

Concurrent Execution on Simulink® Real-Time™

Driver Examples

These driver examples include models and scripts showing the use of driver blocks in a Simulink Real-Time environment. To run some of these examples, you must install specific hardware.

  • Analog and digital I/O

  • ARINC 429

  • Asynchronous events

  • Audio

  • CAN (CAN_MESSAGE data types)

  • Counters, timers, pulse width modulators (PWM)

  • Digital signal processing

  • Encoders

  • EtherCAT®

  • FPGA

  • J1939

  • MIL-STD-1553

  • Precision Time Protocol (PTP)

  • Raw Ethernet

  • RS-232

  • Shared/reflective memory

  • UDP

  • Video

Edit Scripts

To locate and edit an example such as Signal Tracing With a Host Scope in Freerun Mode:

  1. Follow the link to the example and determine its MATLAB file name, in this case scfreerundemo.

  2. In the MATLAB Command Window, type:

    which scfreerundemo

    MATLAB displays the location of the MATLAB example file.

    C:\MATLAB\toolbox\rtw\targets\xpc\xpcdemos\scfreerundemo.m
  3. Type:

    edit scfreerundemo

    MATLAB opens the file in the MATLAB Editor.