Error when deploying mcb_open_loop_control_nucleo_g474re on target
이전 댓글 표시
I am getting an error as shown below, please let me know the resolution:

답변 (1개)
Vedant Shah
2026년 2월 13일
The error occurs because Simulink does not allow changing certain block parameters while the model is running in External mode. In this case, the "Constant block value" inside the Start and Stop Motor subsystem is a non-tunable parameter, so when the model is executing on the target, Simulink cannot update it and throws that error.
To fix this:
One quick ways is to stop the simulation before modifying that Constant value, then run again.
And a more proper way is to:
- Make the parameter tunable by replacing the constant with a variable (e.g., a Simulink.Parameter)
StartMotor = Simulink.Parameter(1);
StartMotor.CoderInfo.StorageClass = 'ExportedGlobal';
and now if we set the value of constant block as "StartMotor", it will become tunable.
- Using an input/dashboard control instead of a Constant block.
For start/stop signals specifically, it’s better to use a runtime input (button, switch, or Inport) rather than a Constant block, since constants are compiled as fixed values during code generation.
For more information, refer to the following documentations:
카테고리
도움말 센터 및 File Exchange에서 Texas Instruments C2000 Processors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!