Effacer les filtres
Effacer les filtres

Has "Sample time" in Simulink some impact on generated code?

1 vue (au cours des 30 derniers jours)
Vit Valek
Vit Valek le 9 Août 2018
Modifié(e) : Mircea Susca le 9 Août 2018
Hello,
has "Sample time" in Configuration Parameters pane some impact on generated code (by using Simulink coder or Embedded coder)? Thanks!
Vit

Réponses (1)

Mircea Susca
Mircea Susca le 9 Août 2018
Modifié(e) : Mircea Susca le 9 Août 2018
Hello,
If you are planning to run the generated code in an interrupt routine which fires periodically according to its sampling period (compared to an infinite loop in the "main" function), the sampling time should be enough to run all code and have a small margin in case of delays (about 10%).
If the code takes longer to run than the sampling times allows it, the microprocessor will keep adding tasks to be executed and errors will occur (stack overflowing etc.). By running the same code in a "while" loop for example, as soon as the execution will finish, it will start again.
Hope I answered your question.
Mircea

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by