From: Matthieu on
Hi everyone,

I have created a S-function and have inlined it by creating a corresponding TLC file.
I had to do it because that S-function is used in a lot of models, and those models constitute a complex model reference hierarchy (all referenced in Accelerator mode to enable multiple instances possible).

Anyway, in my (level 2 C-MEX) S-function I need to throw an error in particular cases (in the mdlOutputs method), for example when the sum of the inports exceed 100 (it is actually more complicated than that, involving external C code, but that's not the point here).
Up to here, no problem.

Using Accelerator model referencing, Simulink generates a Model Reference SIM target for every model in the hierarchy (i.e. a MEX file for each model), when trying to simulate the top model.
The TLC file I created for my S-function is used at this point to handle code generation for S-function blocks of that type.
The problem is: I don't know which TLC commands to use to throw an error in the case described above. During the simulation of the top model, I'd like all possible errors involving my S-function to be displayed on the screen, no matter how deep the error in the hierarchy...

Is it possible?

Thanks,
Matt