Effacer les filtres
Effacer les filtres

Masked parameters does not appear as a tunable parameters at Simulink Real Time Explorer

9 vues (au cours des 30 derniers jours)
I have created a simple model to learn how to work with tunable parameters at Simulink.
The model contains:
  • a gain block (outside the mask) and its value is defined by a variable "scalar_gain" at workspace;
  • a gain block (encapsulated inside a mask) the gain value is define by a variable on the mask "masked_gain", which is defined on the workspace and in the mask tunable attribute is marked "on".
At the following model seeting code generation/optimization/ the default behaviour parameter is Tunable;
Then I compile the code and load it at the targetPC.
I open the Simulink Real Time Explorer and look for the tunable parameters and only the scalar_gain appears.
What I should for the masked parameters to be tunable as well?
Second question how can I retrieve programmaticaly the tunable parameters from simulation? I mean, there is any command that shows me all the tunable parameters in the model?
Thank you.

Réponses (1)

Ayush
Ayush le 29 Déc 2023
Hi Adolfo,
I understand that you want to make your masked parameters as tunable for code generation and visible in the Simulink Real-Time Explorer.
Here are some possible checks and workarounds other than the one mentioned by you to ensure that the parameter is setup to be tunable:
  1. Ensure that the masked parameter is initialized in the correct workspace.
  2. Check the parameter visibility and if it’s set to “None” it won’t be visible outside the mask. Set it to “Public” if you want to make it tunable from the outside.
Additionally, to retrieve the tunable parameters programmatically, you can use the “find_system” function to find the blocks that are set to tunable. You would also have to use “get_param” to get the respective parameter values. Please refer to the below documentation to know more about the “find_system” and “get_param” function respectively:
Hope it helps,
Regards,
Ayush Misra

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by