I'm writing a C++ SFunction for use with Simulink. This SFunciton connects to an exteral code to handle electrical circuit simulation.
In a typical run from Simulink, the following routines are called without any errors being reported by simulink and the C++ SFunctcion works as expecte:
But sometimes after Simulink calls mdlStart() and exits that routine it never calls mdlOutputs() and Simulink doesn't make any simulation progress. It's just stuck at time=0.
I'm not sure how to debug this as it looks like Simulink is not in my code when it hangs. The only way to stop the simulation at this point is to kill the main MATLAB job with "kill -9 <PID>".
Any suggestions on how to debug this?