Simulink variable in Code Composer Studio stops incrementing

1 次查看(过去 30 天)
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)

回答(1 个)

Mark McBroom
Mark McBroom 2024-2-10
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.

类别

Help CenterFile Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by