Trying to use setparam for a parameter inside a referenced model
14 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Pablo Romero
2022 年 4 月 19 日
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 件のコメント
Marcel Schoch
2022 年 4 月 19 日
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
2022 年 4 月 21 日
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.
その他の回答 (2 件)
Marcel Schoch
2022 年 4 月 12 日
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 件のコメント
Stefanie Schwarz
2024 年 2 月 7 日
編集済み: Stefanie Schwarz
2024 年 9 月 19 日
See also this MATLAB Answer:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Target Computer Setup についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!