Can I show text output in the Instrument Panel for Simulink Real-Time Explorer?

5 views (last 30 days)
In my Simulink Real Time model, I get a a numeric message with different error-codes. I currently display the error code in an Instrument Panel in Simulink Real-Time Explorer with a NumericDisplay.
For a more user-friendly Instrument Panel, I would like to show the error text that corresponds to the error code. For example: 
Error # -> String 
--------- -------- 
0001 -> 'Error One' 
0002 -> 'Error Two' 
... 
1312 -> 'really bad Error - turn off everything!' 
Is there an option to display the error text in an Instrument Panel in Simulink Real-Time Explorer? 

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 16 May 2023
Edited: MathWorks Support Team on 17 May 2023
At this time, we currently do not support text display in the Instrumentation Panel of the Simulink Real-Time Explorer.
As a workaround, you may consider the following options:
1) The simplest approach would be to add a label next to the Numeric Display that lists the error codes corresponding to the numeric output:
The attached example shows this workaround. To open it, launch SLRT Explorer with the command "slrtexplr" then select File > Open > Instrument Panel
2) A more involved approach would be to create your own custom Instrumentation Panel that has a text display. To do so, you may consider using App Designer:
You may also want to consult the following examples, which use different approaches for creating custom Instrumentation Panels, but serve as useful references:
Please note that this approach will take significantly more effort.
3) A third approach is to upgrade to R2018a for string support:
With this approach, you could consider running your model in External Mode and using a Multiport Switch on the output data to display the correct error message depending on the error code. However, please note that this approach would be limited to viewing the error code on the Simulink canvas, rather than in the Simulink Real-Time Explorer.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!