Hello, i have a problem with the Real-Time features of MatLab.
I try to run some real time examples, but i always get an error message.
An error occurred while running the simulation and the simulation was terminated
Caused by:
I searched on google but did not really found something.
I am running Matlab 2019b for academic use on a Windoes 10 System.
Thanks in advance!

댓글 수: 6

PRATIK KORE
PRATIK KORE 2020년 8월 30일
Hi Christopher, I am facing same issue. Could you please post if you get any soluaiton for this issue.
Erdi Gülbahçe
Erdi Gülbahçe 2020년 9월 14일
I am having the same problem. Please have a solution.
Daria Nikitaeva
Daria Nikitaeva 2020년 10월 12일
I am also having this issue
Hi,
we solved the problem with de- and reinstalling the realtime kernel. Occurs after an Windows update...
hope that helps
greetings Sabine
Nazmi Rosly
Nazmi Rosly 2021년 8월 23일
I also faced this problem. I have tried uninstall and install back the realtime kernel but it seems not to work
  • Error reported by S-function 'sldrtoo' in 'scope/ThingSpeak Output': Hardware timer cannot be allocated. Real-time kernel cannot run.
Walter Roberson
Walter Roberson 2021년 8월 23일
Possibly that message could also be generated if the design required more hardware timers than existed for the device. It has been years since I saw the messages posted for that context, so I do not recall at the moment whether that case would generate this message or would generate a different more-specific message.

댓글을 달려면 로그인하십시오.

 채택된 답변

Jan Houska
Jan Houska 2023년 2월 16일

0 개 추천

Hello,
the inability to allocate hardware timer for the real-time kernel is most often caused by hardware or software incompatibility between the real-time kernel and the operating system or the computer mainboard.
First, please try to use the latest available release of MATLAB and Simulink Desktop Real-Time, because compatibility between the real-time kernel and latest updates of operating systems is being constantly improved from release to release.
If you are already using the latest version of Simulink Desktop Real-Time and think that the reason is hardware incompatibility, please go to Device Manager and search the System Devices section for High Precision Event Timer (HPET). If the HPET device is not present, it may be disabled in BIOS settings and needs to be enabled there.
Jan

댓글 수: 7

Oren Savir
Oren Savir 2023년 11월 7일
hello, i have the same problem, but i cant find the solution.
i checked the device manager and the HPET is installed with the latest driver version.
any ideas what else i can do ?
thanks in advance.
Jan Houska
Jan Houska 2023년 11월 13일
Hi Oren,
please try the latest MATLAB version if you haven't already. The compatibility with latest OS versions is being improved and maintained, and the diagnostics as well. If you still have problems, please post your MATLAB version and the exact version of your operating system. Or contact MathWorks technical support.
Jan
Priyabrata
Priyabrata 2024년 2월 26일
편집: Priyabrata 2024년 2월 26일
Hi Jan Housaka,
I am also facing similar issue as
Error:An error occurred while running the simulation and the simulation was terminated
Caused by:
Error reported by S-function 'sldrtpi' in 'filename/Packet Input':
Hardware timer cannot be allocated. Real-time kernel cannot run.
MATLAB Version: 23.2.0.2515942 (R2023b) Update 7
Operating System: Microsoft Windows 11 Enterprise Version 10.0
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
I have checked High Precision Event Timer and it is there. Simulink DesktopRealtime is also updated one.
Jan Houska
Jan Houska 2024년 2월 27일
Hi Priyabrata,
for R2023b, please try to enable Hyper-V, the Microsoft hypervisor component, if you don't have it enabled already. This can solve the issue with not enough hardware timers available. Note - this recommendation is only valid for R2023a and later. Doing this for earlier versions will actually make things worse.
Good Luck, Jan
Jizheng
Jizheng 2025년 8월 25일
Hi Jan
I have checked HPET and Hyper-V. They are all enabled. However, I am still facing the error :"Hardware timer cannot be allocated. Real-time kernel cannot run."
MATLAB Version: R2023a Update 2(9.14.0.2254940) Academic Use
Operating System: Windows 11 24H2 Family Version
Thanks in advance!
Jan Houska
Jan Houska 2025년 8월 25일
Hi Jizheng,
please update to the latest R2023a Update 8, then reinstall the kernel using sldrtkernel -setup. The update contains some compatibility improvements with Windows 11 and has a good chance to help.
Good Luck, Jan
Jizheng
Jizheng 2025년 9월 1일
Hi Jan
That works!Thanks a lot!
Jizheng

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Troubleshooting in Simulink Desktop Real-Time에 대해 자세히 알아보기

질문:

2020년 7월 22일

댓글:

2025년 9월 1일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by