필터 지우기
필터 지우기

Non-zero start time in Rapid Simulation Target

조회 수: 13 (최근 30일)
Matthew
Matthew 2013년 12월 13일
댓글: Matthew 2013년 12월 19일
When I try to execute my Simulink model using the Rapid Simulation target and the Start time is non-zero, I get the following error:
"Start time must be zero for real-time systems. For non-zero start times you must use the Simulink solver module."
This warning apparently comes from rt_sim.c.
My questions:
1. Why can't I use a non-zero start time? (Why should it matter what the value of t0 is?) 2. What does "you must use the Simulink solver module" actually mean? Does it mean I can't compile my model? i.e. I must open the model and click the run button? 3. Is there a way around this? I've tried to set solver options and pass them in using the -S flag, but this doesn't work. 4. Perhaps I have to set Start_time=0 in the model gui, but pass in a non-zero start time?

답변 (1개)

Guy Rouleau
Guy Rouleau 2013년 12월 13일
I will not go into details... with RSim target you have an option to choose a solver. See this link to see how to configure this parameter:
With the Simulink solver, you have more flexibility.
  댓글 수: 1
Matthew
Matthew 2013년 12월 19일
Thanks for the rapid response, but it still isn't clear to me that it can be done.
The only way I found to change this parameter is to get the active configuration for the model and use set_param to change StartTime. This means I have to recompile the model. Instead, I'd like to change or set this parameter when I call the compiled executable (as with inline parameters in the rapid simulation target).
Actually, I also haven't been able to change parameters using the inline parameters option. I thought I figured this out:
1. Select Inline parameters box under Optimization->Signals and Parameters 2. Configure the parameter to be a Global (tunable) parameter 3. Build make file and compile 4. Retrieve the rtP for the model using rsimgetrtp 5. Set the tunable parameter to the new value using rsimsetrtpparam 6. Save rtP to .mat file 7. Pass .mat file in at runtime using -p switch
Even though my tunable parameter shows up in the rtP structure, the variable (in the executable) is unchanged from the value it was set to before I compiled the model.
My next step will be to use gdb to attach to the executable, but I wanted to see if the procedure above is correct. Can you confirm?
Thanks!

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

카테고리

Help CenterFile Exchange에서 Accelerated Simulation에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by