How to display diagnostic warning message in SFunction

1 visualización (últimos 30 días)
Wesley Lao
Wesley Lao el 31 de En. de 2018
Respondida: Jyotish Robin el 9 de Feb. de 2018
I have an Sfunction and I would like to display a warning message in the diagnostic viewer. I called
ssWarning(Simstruct *S, const char* message) within mdlOutput.
The message shows up in the diagnostic viewer but it is displayed as info message, not warning message. If you filter out info message in the diagnostic viewer, it went away.
My question is how you could display a message as warning instead of info.
BTW, ssSetErrorStatus and ssPrintf works fine.

Respuestas (1)

Jyotish Robin
Jyotish Robin el 9 de Feb. de 2018
Hi!
I am not able to reproduce this behavior on my end. The documentation page for ssWarning shows an example "sfcndemo_sfun_dynsize", which contains an S-function "sfun_dynsize" that uses ssWarning.
When you disconnect the input port to the S-function and do a model update, it indeed throws yellow warning messages in the Diagnostic Viewer. Everything works as expected.
Thanks,
Jyotish

Categorías

Más información sobre Configure and View Diagnostics en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by