Trying to use setparam for a parameter inside a referenced model

조회 수: 13 (최근 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

채택된 답변

Pablo Romero
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
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
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
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.

Stefanie Schwarz
Stefanie Schwarz 2024년 2월 7일
편집: Stefanie Schwarz 2024년 9월 19일

카테고리

Help CenterFile Exchange에서 Target Computer Setup에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by