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

22 visualizzazioni (ultimi 30 giorni)
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!

Risposte (1)

Reshma Nerella
Reshma Nerella il 28 Ago 2020
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 Commento
Aryaman Pandav
Aryaman Pandav il 13 Mar 2021
Modificato: Aryaman Pandav il 13 Mar 2021
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.

Accedi per commentare.

Categorie

Scopri di più su Schedule Model Components in Help Center e File Exchange

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by