Simulink Real Time Desktop Runs too Fast?

조회 수: 14 (최근 30일)
Kyle Smith
Kyle Smith 2022년 11월 1일
댓글: Jan Houska 2022년 11월 1일
Hello all, my question is about Simulink Real Time Desktop for Matlab version 2022a. Strangely, when I specify the stop time for my simulation as 10 seconds, it only runs for 5 seconds in real time. If I change the stop time to something else, it is always exactly half the time I specify. My solver is a FixedStepDiscrete with a time step size of 1 second.
I am unsure why this is the case, but would like to change it so that if I specify 10 seconds of run time, it actually runs for 10 real seconds. Help is appreciated!
On the same topic of real-time simulations, is it possible to make the scope block auto-scale the time axis (grow it) as the simulation progresses, for the case where the stop time is set to 'inf'. I noticed there are options to 'scroll' or 'wrap' the time axis but both of these only show updates in a fixed window length.
Thanks for any suggestions.

채택된 답변

Jan Houska
Jan Houska 2022년 11월 1일
Hi Kyle,
are you running in Connected IO or Run In Kernel mode? If Connected IO, please make sure that you have at least one of the Simulink Desktop Real Time I/O blocks or the RT Sync block present in your model. If Run In Kernel, this should never happen and you should probably contact tech support.
Good Luck, Jan
  댓글 수: 2
Kyle Smith
Kyle Smith 2022년 11월 1일
Hi Jan, I am running in Connected IO mode. I had the RT sync block commented out, but uncommenting this seemed to solve the issue. I had it commented out initially because an example file had a comment saying "Use the Real-Time Synchronization block only if no I/O block is used".
I thought since I was using a serial receive block from the instrument control toolbox, that I was supposed to have it commented out. I'm not sure what that statement means by "I/O block".
Thanks!
Jan Houska
Jan Houska 2022년 11월 1일
Hi Kyle,
"I/O block" here means one of the Simulink Desktop Real Time I/O blocks. All these automatically synchronize to real time, but blocks from other toolboxes do not, so the RT Sync block is required for the synchronization if blocks from other toolboxes are used for I/O.
Jan

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Target Computer Setup에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by