I have been using legacy code tool to create interface templates between Simulink and custom C/C++ algorithm code. I would like to be able to report errors from my C/C++ code back to Simulink and in the process terminate a simulation run. The function to do this seems to be ssSetErrorStatus().
Calling ssSetErrorStatus requires a SimStruct structure as an argument. Unfortunately, the legacy code tool does not seem to provide a way to generate interface code which passes a SimStruct structure to the C code. This means that one cannot write C code which reports errors without modifying the code which legacy code tool creates.
Best Answer