Simulink variable in Code Composer Studio stops incrementing

3 vues (au cours des 30 derniers jours)
Kemal Tas
Kemal Tas le 7 Fév 2024
I am trying to calculate the total battery consumption (in watt/hours) using simulink model. For this ,using 2 ADC modules, i first scale the adc values to get the correct voltage and current values. Then, i divide the power with 3600(watt/hours) * 20000(adc sample time) to find the power value for cycle. The data type is single. The problem is, when i generate ccs project and run it, the consumption value is type float, and when i constantly have 64V and 1A, about 5 minutes later, the total consumption stops at value 32.0 . A counter(type double) that i put in the code to watch the cycles per second also stops at about 16.770.000. How can i fix this? (F280025C)

Réponses (1)

Mark McBroom
Mark McBroom le 10 Fév 2024
It sounds like that section of your code is no longer running. You can use CCS to set a breakpoint to confirm this or you can add blocks to your simulink model that toggle an output/LED to make sure your code is still running.

Community Treasure Hunt

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

Start Hunting!

Translated by