A fixed-step task returned an invalid next sample hit.

조회 수: 9 (최근 30일)
Marko
Marko 2018년 3월 15일
댓글: Marko 2018년 3월 17일
I'm trying to run a Simulink model and simulation where I save the final state and want to restore that state in the next simulation but I obtain the following error:
Implementation error: A fixed-step task returned an invalid next sample hit.
Has this happened to anyone else and does anyone know the solution to this?
I am using a variable time step with automatic solver selection.

채택된 답변

Wolfgang Hammer
Wolfgang Hammer 2018년 3월 16일
This error message comes from a PLECS Circuit block in your model, but without more information it is impossible to tell what has caused this error.
One known source of this error is an apparent bug in Simulink R2017a and newer regarding the execution of continuous-time S-Functions that register only discrete state variables (bug report filed). This also applies to a PLECS Circuit block that contains only discrete blocks or modulators. As a workaround you could simply add an Integrator block to the Circuit schematic (without connecting it).
If this does not apply to your problem, feel free to contact Plexim support.
  댓글 수: 1
Marko
Marko 2018년 3월 17일
Actually a colleague managed to figure out the problem. It's in the set_param function. The function should be called like this:
set_param('SaveCompleteFinalSimState','off')

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by