Simulink model -Code generation
조회 수: 13 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
Akshat Dalal
2024년 8월 16일
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.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!