control simulink panel dashboard programmatically

1 回表示 (過去 30 日間)
skamajaya
skamajaya 2024 年 10 月 2 日
コメント済み: Daniel 2024 年 10 月 2 日
I want to create an application using simulink dashboards wich are put in panel.
is there any documentation on parameters that i can set using set_param on this panel?
Thanks

回答 (1 件)

Daniel
Daniel 2024 年 10 月 2 日
There is information on how to attach dashboard blocks programmatically here (for the Knob dashboard block, as an example) and here (for the data type). You have to create a Simulink.HMI.ParamSourceInfo object. At a minimum you have to set the BlockPath member of that object to the path to the block you want to connect. Depending on which dashboard block you're trying to use, you may need to set other parameters as well.
Other information will depend on the specific dashboard block you want to use and how you want to use it. In some cases (with the Knob, for instance), the value you set through the dashboard block is propagated directly to the target parameter, so it's not actually stored in the Knob block.
  2 件のコメント
skamajaya
skamajaya 2024 年 10 月 2 日
Hi,
thanks for your answer.
i am sorry to not gave precise context on my question. I am talking about panel where this dashboard can be put. My idea is to "open this panel in new window" then maximize it when i load the simulink model. I have multiple panel which i must put in different screen.
I tried to use findobj(), but it doesn't gives any handles.
Daniel
Daniel 2024 年 10 月 2 日
Ah. I'm definitely not an expert on panels, but the doc you linked contains this phrase: "When you use panels, the blocks in the panel are not associated with the model in the same way as blocks in the canvas. You cannot programmatically interact with blocks in panels using get_param, set_param, gcb, or gcbh. Otherwise, blocks promoted to panels retain their interactive behavior."

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeControl Simulations with Interactive Displays についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by