MATLAB Answers

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

3 views (last 30 days)
Michael
Michael on 16 Apr 2014
Edited: Michael on 16 Apr 2014
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 Comments

Sign in to comment.

Answers (0)


Translated by