how to generate an infinitely running code in simulink embedded coder?

how to generate an infinitely running code in simulink embedded coder like how we use in legacy code
example:
void main(){
for(;;){
}
}
I have used idle task block but it has some limitations like some blocks like can transmit in c2000 micro controller blockset takes a auto sample time of 0.2 sec but simulink shows an error if time based blocks are included in idle task block function

Respuestas (1)

Michael
Michael el 7 de Abr. de 2025
Normally you only have to set the "Stop time" in the Configuration Parameters --> Solver option or directly in the model to "inf". Then starting code generation.

3 comentarios

Even after changing the stop time in solver options to inf an infinitely running code is not generated
Please help!
And after what time does the code execution stop?
I'm speaking about execution in code
I want all my code to be in while 1 after generation

Iniciar sesión para comentar.

Categorías

Más información sobre Deployment, Integration, and Supported Hardware en Centro de ayuda y File Exchange.

Preguntada:

el 7 de Abr. de 2025

Comentada:

el 17 de Abr. de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by