Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

Has anyone faced this problem - The simulation gets stuck in the "Initialization" phase?

0 votes
11,917 views
I have a model of a 3ph Inverter on PLECS Standalone, and the issue is that PLECS gets indefinitely stuck in the "Initialization" phase after I give the "Run Simulation" command, after which I then have to close the application from Task Manager. Sometimes the PLECS app just crashes as soon as I give the Run command.

There is nothing wrong with my initialization parameters, I have used the same on other models which run without any problem.

The only difference in this model from other similar variants that I've run successfully, is a C-script block which contains about a 1000 lines of code. Assuming that it takes time to process the fairly complex model, I've waited up to even an hour, but it never gets past the initialization part. There's no error message that shows up as well, so I haven't made much progress in solving the issue so far.

Any feedback is much appreciated!
asked Dec 15, 2023 by Aditya Rao (12 points)

1 Answer

0 votes

If the only difference between this model and a working variant is the C-script then the cause of the stuck simulation is most probably - surprise - the C-script.

Good C-scripts are hard to write and harder to debug. If there is, for example, an endless loop in your 'Start function code', PLECS will hang on model start and there is no chance to stop the simulation.

Debug your C-script, for example by adding printf in your code to verify that the end of your 'Start function code' is reached. This way you may be able to find where your C-script gets stuck.

answered Dec 19, 2023 by Oliver Schwartz (622 points)
...