Why do I get the error: "Cannot change parameter while simulation is running" when running my Simulink model in "Monitor and Tune" mode on external hardware?

33 ビュー (過去 30 日間)
I cannot change any of my model parameters when I run my Simulink model in External Mode ("Monitor and Tune") with supported hardware, like TI C2000 or STM32 boards. When I try to change a parameter on my Simulink model, I face this error:
"Cannot change parameter 'Constant value: (Value)' of 'ePWM_LED/Constant' while simulation is running".
What can I do to be able to tune parameters without stopping the simulation?

採用された回答

MathWorks Support Team
MathWorks Support Team 2025 年 8 月 19 日
The “Default Parameter Behavior” is currently set to "Inlined" in the model configuration, whereas it needs to be set to “Tunable” to change parameter values during run-time.  You can find this setting by referring to "Configuration Parameters" -> "Code Generation" -> "Optimization" -> "Default parameter behavior". Please see the image below. 
With the setting configured to: 
  • “Inlined”: The values cannot be changed during run-time. This setting generates optimized code wherein the values of the corresponding blocks parameters are inlined to reduce RAM usage. 
  • “Tunable”: The values can be changed during run-time. This setting generates code with the values of the corresponding block parameters set as tunable fields of a global parameters structure. 
For more info on the setting, please refer to the doc page: 

その他の回答 (0 件)

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by