Real-Time in R2011b?
조회 수: 2 (최근 30일)
이전 댓글 표시
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
채택된 답변
Fangjun Jiang
2011년 11월 3일
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
Fangjun Jiang
2011년 11월 3일
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.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Development Computer Setup에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!