A fixed-step task returned an invalid next sample hit.
13 views (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
Wolfgang Hammer
on 16 Mar 2018
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).
More Answers (0)
See Also
Categories
Find more on Programmatic Model Editing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!