Simulink® Real Time Execution
by Guy Rouleau
27 Oct 2008
(Updated 22 Jul 2010)
C-MEX S-function that reduces the execution speed of a model close to real time
|
Watch this File
|
| File Information |
| Description |
This block should be used only to reduce the speed of a Simulink® model so that it can be observed running in real time. If the simulation is already slower than real time, this block has no effect.
To use it, extract the files to a directory on the MATLAB path. Re-open the Simulink browser and you should see a new library named "Useful Stuff" which contains one block named "Real-Time Subsystem". Place this block in a model to use it.
To use this file under other operating systems, just run "mex sfun_time.c" to generate the MEX-file for your platform
For accurate hard real-time, I recommend looking at xPC Target or Real-Time Windows Target. |
| Required Products |
Simulink
|
| MATLAB release |
MATLAB 7.7 (R2008b)
|
| Other requirements |
You will need to re-mex the s-function for other platforms. |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 08 Jan 2009 |
Updated to allow scaling of time. It is now possible to specify that one second of simulation is X seconds in real life. |
| 26 Feb 2009 |
To use this file under other operating systems, just run "mex sfun_time.c" to generate the MEX-file for your platform |
| 18 Jun 2009 |
Minor modif for BSD license |
| 21 Jul 2010 |
- Fixed a bug causing the model to freeze after 36 minutes on some Unix systems.
- Possible to tune the Time Scaling Factor while the simulation is running.
- Possible to pause and restart the simulation. |
| 22 Jul 2010 |
Fixed bug causing the model to freeze after 36 minutes on Linux 32-bit systems |
|
Contact us at files@mathworks.com