Application and Driver Scripts
These examples show the features of Simulink® Real-Time™. Use these scripts as a starting point for writing your scripts for creating and testing real-time applications.
These 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 | |
Log signal data with the Simulation Data Inspector to a file on the development computer | |
Create a custom client application to interface with the target computer | |
Concurrent execution of a model by using the Simulink Real-Time profiling tool |
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)
Ethernet
RS-232
Shared/reflective memory
UDP
Edit Scripts
To locate and edit an example such as Apply Simulink Real-Time Model Template to Create Real-Time Application:
Open the example scripts folder. In the MATLAB Command Window, type:
cd (fullfile(matlabroot,'examples','slrealtime','main'))
Use the descriptive names of the example scripts (similar to the example title) to find the script.
Open the script. For example, in the MATLAB Command Window, type:
openExample('slrealtime/ApplySlrealtimeModelTemplateToCreateRtAppExample')