How do I use the block's input signal in a callback for Check Static Range block?

1 回表示 (過去 30 日間)
Michael
Michael 2014 年 4 月 16 日
編集済み: Michael 2014 年 4 月 16 日
I am currently checking the reasonableness of the value of a signal in my Simulink model using the Check Static Range block. It works just fine (warning and optionally stops the simulation), but it is unclear whether the cause for the assertion failure is that the input is out of range on the high side, out of range on the low side, or NaN. I see there is a space to add a callback when the assertion fails, but I am not sure how to get it to display the value that is coming into the Check Static Range block. What I want to do is along these lines:
disp(['Check Static Range Input = ' num2str(get_param(gcb,'InputValue'))])
However, 'InputValue' is not a real block property that gives the current value on the wire going into the block; it's just what I wish existed... Also, I think the callback put in the Check Static Range block's mask actually gets dumped into the Assertion block that's under the mask rather than the Check Static Range block which complicates things even further (what would gcb evaluate to, how do I get the value on the wire of the right block, etc.).
Any ideas?

回答 (0 件)

カテゴリ

Help Center および File ExchangeTest Model Components についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by