フィルターのクリア

Simulink get_param and RuntimeObject

22 ビュー (過去 30 日間)
Alexandru
Alexandru 2012 年 11 月 6 日
Hello!
Is there a way to write this command: rto_add = get_param('TestMdl2/Add','RuntimeObject'); in one of the "Model callbacks" and to work while running the simulation?
I read that is possible to get the result if I use the PostLoadFcn function. The article said: "In a PostLoadFcn callback routine, however, get_param returns the model's parameter values because the model is loaded."
But it's not working...
What I want to do is to get my result and to display it on a GUI, but in real time while running the simulation.
Thanks!

採用された回答

Ryan G
Ryan G 2012 年 11 月 6 日
  1 件のコメント
Kaustubha Govind
Kaustubha Govind 2012 年 11 月 6 日
Ryan: I wonder if the second link is supposed to point to this topic: http://www.mathworks.com/help/simulink/ug/accessing-block-data-during-simulation.html
Alexandru: In general, get_param should indeed work in or after the PostLoadFcn to query parameter settings. However, the RuntimeObject property is only accessible during simulation. Of all the model callback functions, the only ones that may be called during simulation are PauseFcn and ContinueFcn - the right way to use the RuntimeObject is using event listeners as Ryan suggested.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeModel, Block, and Port Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by