Trying to use setparam for a parameter inside a referenced model
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Calvin Watson
am 21 Jan. 2022
Bearbeitet: Stefanie Schwarz
am 19 Sep. 2024
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
0 Kommentare
Akzeptierte Antwort
Pablo Romero
am 19 Apr. 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 Kommentare
Marcel Schoch
am 19 Apr. 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
am 21 Apr. 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.
Weitere Antworten (2)
Marcel Schoch
am 12 Apr. 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.
0 Kommentare
Stefanie Schwarz
am 7 Feb. 2024
Bearbeitet: Stefanie Schwarz
am 19 Sep. 2024
See also this MATLAB Answer:
0 Kommentare
Siehe auch
Kategorien
Mehr zu Target Computer Setup finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!