Real-Time in R2011b?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
I have used simulink before to create an aircraft simulation that runs in what I call "simulation" time.
I now need to set up a model which runs in a real-time environment. At the moment the simulation runs faster than real-time.
Does anyone have any guidance on how to set up the model such that I can make it run in real-time in MATLAB/Simulink R2011b. I have the Simulink Coder blockset.
Thank you in advance for any help with this.
0 Commenti
Risposta accettata
Fangjun Jiang
il 3 Nov 2011
To make the simulation "really" in real-time, you need to run the simulation in a target (micro-controller) with a real-time operation system (RTOS). Your PC or MAC is unlikely a real-time target. xPc Target can boot your PC as a real-time target but that's a different story.
If you just want to slow down your simulation to close to real-time, you can use Guy Rouleau's S-function.
3 Commenti
Fangjun Jiang
il 3 Nov 2011
As long as the model or code is executed in a CPU without RTOS, you can't achieve true real-time. Your input may be in real-time. But your computer does not have the capability to match or sync with it. What if your computer suddenly needs to launch the Internet Explorer, or interrupted by some background process? I think you understand this. With the high CPU power, you can slowdown it on purpose to closely match real-time. But you can't achieve the true real-time. So don't run real-time critical application using this approach.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Target Computer Setup in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!