Simulink model -Code generation

1 visualizzazione (ultimi 30 giorni)
Jérôme Tisserat
Jérôme Tisserat il 6 Ott 2016
Risposto: Akshat Dalal il 16 Ago 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

Risposte (1)

Akshat Dalal
Akshat Dalal il 16 Ago 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.

Categorie

Scopri di più su Simulink Coder in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by