Make Simulink Real-Time Parameters Tuneable

When using R2025b with previously tunable models, we have noticed that items such as constant blocks no longer appear as tunable parameters for us to modify within the real-time application on a Speedgoat target.
Is there a way to force the model to make specific block parameters tunable?
I've considered the guidance provided on the page Tunable Block Parameters and Tunable Global Parameters but this doesn't offer an actual solution
For example, we have a constant block with the value '5' and during model exection we want to change it to '6'. We have tried setting this value as a parameter on the base workspace and model workspace and this does not seem to force the tunability.
Is setting tunable parameters as base/model workspace parameters required? This seems like a backwards step from previous MATLAB versions where any constant block could be a tunable parameter.

2 个评论

Editing not working:
The parameters are visible within the Application Inspector but don't appear on the parameters tab once the application has been loaded on to the target PC.
The following guidance on Parameter Sets instruct the user to save and import a Parameter Set from the application using the command line. It is interesting that this option isn't available from the Simulink Real-Time Explorer if this is necessary to view parameters.
Also raises concerns about how a standalone MATLAB Compiler generated app could be used to modify tuned parameters of a real-time application.

请先登录,再进行评论。

回答(1 个)

The behavior you are seeing can occur when a Constant block value is entered directly as a literal such as 5. In that case, Simulink may treat the value as compile-time data and optimize or inline it during code generation, which can prevent it from being exposed as a tunable runtime parameter on the Speedgoat target.
To preserve tunability, use a Simulink.Parameter object and reference that object from the Constant block. For example:
K_const = Simulink.Parameter(5);
Then set the Constant block Value parameter to:
K_const
A few important points:
  • Simply placing a value in the base or model workspace does not guarantee runtime tunability.
  • What matters is whether the value is preserved as a tunable parameter during code generation.
  • Parameter inlining or other optimizations can remove the parameter from the runtime application.
Regarding the UI behavior:
  • If the parameter appears in the Application Inspector, the application contains metadata for that parameter.
  • If it does not appear in the Parameters tab after deployment, it is likely not exposed as a runtime-tunable parameter on the target.
  • Parameter sets help manage values of existing tunable parameters; they do not make parameters tunable.
For standalone workflows, tunable parameters can also be modified programmatically through the Simulink Real-Time APIs, provided they are available for runtime tuning in the deployed application.

2 个评论

Any idea why this is new behaviour? We've been using constant blocks as configurable parameters within models since at least 2018 and R2025b seems to be the first version where we've encountered this.
A lot can change in this 7 years span wrt Simulink but I would recommend getting in touch with MathWorks Support, as they may have better insight into this issue.

请先登录,再进行评论。

产品

版本

R2025b

提问:

2026-8-5,8:36

评论:

nws
2026-8-20,3:38

Community Treasure Hunt

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

Start Hunting!

Translated by