How can I display bool values while executing a program on a connected device?

23 次查看(过去 30 天)
I've come up with a simple Simulink function block to check whether an input signal QtyToCheck is within range of LowerBound and UpperBound. If the signal is within range, the output QtyInRange should be true (1). If not, the output should be false (0).
I put in some display blocks (from the Simulink/Sinks library) to check the functionality of this code. I then connected it to a TI Delfino F28379D Launchpad and executed the program in "monitor and tune" mode. However, it seems like the display blocks are unable to display boolean values. As you can see, the display blocks show 0 even when the outputs should be true (1).
When I change the outputs of the relational operators (<, >) as well as the AND block to fixdt(1,16) instead of boolean, the display blocks suddenly start outputting the expected values.
My question is, is there any way to get the display blocks to show boolean values? The reason I'd prefer to stay away from fixdt(1,16) is the time potentially wasted in the conversion step. It may be that I'm mistaken and this conversion doesn't in fact contribute significantly to the overall execution time, in which case please let me know!
Alternatively, if I can't use the Simulink/Sinks/Display block to display a boolean, is there a different block I can use? I also tried using the Simulink/Dashboard/Display block with no success.
Thanks!

回答(1 个)

Reshma Nerella
Reshma Nerella 2020-8-28
Hi,
As per my understanding you want to find if the value is within the limits and get the boolean output.
To check if the value is within the limits, you can use INTERVAL TEST block and modify the Output data type for the block as boolean to get required output.
  1 个评论
Aryaman Pandav
Aryaman Pandav 2021-3-13
编辑:Aryaman Pandav 2021-3-13
Thanks Reshma,
My question was not about how to get a boolean output. The second image above was configured to give a boolean output.
My question was how to display a boolean output, because for some reason the regular Simulink display blocks don't seem to work with booleans.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Schedule Model Components 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by