Force C-code recompile in Simulink

2 visualizzazioni (ultimi 30 giorni)
Thomas
Thomas il 14 Gen 2017
Risposto: Thomas il 15 Gen 2017
Hi Guys,
I've been able to create a Simulink model, which utilizes some C++ code that I have created; code that will generate sine/cosine from input radians. Within the code, I have a #define which will vary how accurate the generated sine/cosine output is. Currently, if I run the model, it works as expected, if I then change the value of this #define, Simulink doesn't then re-compile the updated code. The only way that I have found which forces this re-compile, is if I go into the "Configuration parameters" and delete the include files within "Simulation Target\Header file", apply, and then run the model. Which will then result in the use of the new #define value.
Is there any setting, that I am missing, which will force a re-compile of the C-code when I run the model?
  1 Commento
Thomas
Thomas il 15 Gen 2017
Modificato: Thomas il 15 Gen 2017
Have had a major play on this issue, and believe that I have found a way around this. I've created a function which will look within the working directory for a '.mexw64' file, and delete it (as this contains the compiled code). This as been configured such that it runs at initialisation of my model and voila, everytime that I change my C++ code and then run my model it retrieved the latest version! Note entirely sure if this is the correct way to fix this problem, but it appears to be working

Accedi per commentare.

Risposta accettata

Thomas
Thomas il 15 Gen 2017
After using the function that I've mentioned in my comment, I think that I have answered my problem.

Più risposte (0)

Categorie

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

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by