| Writing S-Functions | ![]() |
ssSetErrorStatus Termination Criteria
When you call ssSetErrorStatus and return from your S-function, Simulink stops the simulation and posts the error. To determine how the simulation shuts down, refer to the flow chart figure on How Simulink Interacts with C S-Functions. If ssSetErrorStatus is called prior to mdlStart, no other S-function routine will be called. If ssSetErrorStatus is called in mdlStart or later, mdlTerminate will be called.
| Exception Free Code | S-Function Examples | ![]() |