Trying to use setparam for a parameter inside a referenced model

13 visualizaciones (últimos 30 días)
Hello,
I am deploying a model hierarchy onto a SpeedGoat for real time deployment. The intention is to control the SpeedGoat outputs in real time using a GUI. I have allowed tuneable parameters in all of the models being deployed onto the SpeedGoat. When I load the model onto the SpeedGoat only the top model tuneable parameter blocks are visible. The GUI interface model is a referenced model and so I need to access those blocks via "setparam" but the function cannot find the parameters as none of the referenced models appear to have tuneable parameters on the Simulink Real Time Explorer.
Is there a setting somewhere that is preventing referenced models from having tuneable parameters?
I want to avoid having to create variables for each block parameneter in order to tune it so I was hoping there was another way.
Any help on this is appreciated.
Calvin

Respuesta aceptada

Pablo Romero
Pablo Romero el 19 de Abr. de 2022
There are some limitations on tuning parameters in referenced models. For more information about using instance-specific block parameters and using model arguments to configure these, see:
  2 comentarios
Marcel Schoch
Marcel Schoch el 19 de Abr. de 2022
So no, it is not possible to tune parameters in referenced models without creating a variable.
This is highly inconvenient. Please consider re-enabling this possibility.
Calvin Watson
Calvin Watson el 21 de Abr. de 2022
I have resorted to creating variables for each tuneable parameter. It is a little frustrating as it is one method for real time and one method for simulation running for varying parameters.

Iniciar sesión para comentar.

Más respuestas (2)

Marcel Schoch
Marcel Schoch el 12 de Abr. de 2022
I'm having the exact same problem since the upgrade to the 64bit Speedgoat real-time OS.
I have a very large model with dozens of referenced models. With Matlab 2018b and the old real-time OS, I could easily access any (available) block parameter. Now I'm trying to upgrade the model to 2021a, which includes the upgrade to the 64bit real-time OS, but unfortunately, only the top level block parameters can be accessed.
I have attached a small example that illustrates the problem. It consists of "Mainmodel" and a referenced model "Submodel", and each system contains a delay-block. The delay-block output signal can be accessed in both the mainmodel and the submodel. But the parameter "InitialCondition" can only be accessed in the mainmodel.
tg.getsignal('Mainmodel/Delay', 1) % works
tg.getsignal({'Mainmodel/Model', 'Submodel/Delay'}, 1) % works
tg.getparam('Mainmodel/Delay', 'InitialCondition') % works
tg.getparam({'Mainmodel/Model', 'Submodel/Delay'}, 'InitialCondition') % error: Unrecognized field name "typeInfo".
Any suggestions? This is a major problem for my system upgrade.

Stefanie Schwarz
Stefanie Schwarz el 7 de Feb. de 2024
Editada: Stefanie Schwarz el 19 de Sept. de 2024

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by