How can I display bool values while executing a program on a connected device?
9 次查看(过去 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).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/350042/image.jpeg)
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).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/350045/image.jpeg)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/350048/image.jpeg)
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!
0 个评论
回答(1 个)
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.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!