Simulink model -Code generation

1 visualización (últimos 30 días)
Jérôme Tisserat
Jérôme Tisserat el 6 de Oct. de 2016
Respondida: Akshat Dalal el 16 de Ag. de 2024
Hello
I am currently trying to generate C++ code from a Simulink model (code only for grt.tlc system target file). The model includes some s-functions in which the mdlstart() functions are waiting for outside signal (TCP connexion).
I can't send those signal during code generation. However, the code generation phases includes build and initialization steps. So then, initialization triggers mdlstart functions in s-function blocks.
Is there a way to avoid this intialization step during code generation (options in configuration parameters window)?
Thank you

Respuestas (1)

Akshat Dalal
Akshat Dalal el 16 de Ag. de 2024
Hi Jerome,
One way to achieve this is to use the “ssRTWGenIsCodeGen” function. This function detects whether the S-Function is being used for standalone code generation.
You can modify your mdlStart() function to check whether it is being executed during code generation or during normal execution. This can be done by using the “ssRTWGenIsCodeGen” function, which returns true if the model is being compiled for code generation.

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by