Real-Time Pacer for Simulink
Editor's Note:该文件被选为Matlab CentralPick of the Week
The RealTime Pacer block slows down ("paces") simulation time so that it synchronizes with real elapsed time. The degree of slowdown is controllable via a Speedup parameter.
1)该块是使用M s功能实现的,因此它可以在任何受支持的Simulink平台上使用。万博1manbetx万博1manbetx它不支持代码生成。万博1manbetx
2) The block uses the MATLAB PAUSE function to slow down the simulation. The PAUSE command gives up the processor during the pause, so system performance does not degrade.
3) The M-S function illustrates how to use nested functions to simplify the code.
The matching between simulation time and elapsed real time is approximate, with expected differences on the order of 10 to 30 milliseconds. This limitation is due to difficulties of precise timing with a multitasking operating system.
--------
RELATED FX ENTRIES
The following FX entries also implement "real time" functionality for Simulink. They are based on C S-functions and therefore support code generation.
* Simulink Real Time Execution (Real-Time Slower) (Filex# 21908)
* Real-Time Blockset 7.1 for Simulink (Filex# 3175)
* RTsync Blockset (Filex# 24975)
Cite As
Gautam Vallabha (2022).Real-Time Pacer for Simulink(//www.tianjin-qmedu.com/matlabcentral/fileexchange/29107-real-time-pacer-for-simulink), MATLAB Central File Exchange. Retrieved.
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired:MBDアプリ:衝突防止システムモデル,Mars Rover Robot - 2014 Competition,Simulink-Xplane10 Communication Via UDP,用于Simulink和Matlab的Arduino温度控制实验室万博1manbetx,Fidget Spinner 3DOF Gyro (Simscape Multibody),Sphero Connectivity Package
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.