Main Content

Display

Display signal value during simulation

  • Dashboard Display block

Libraries:
Simulink / Dashboard

Description

The Display block connects to a signal in your model and displays its value during simulation. You can configure the appearance and format of the Display block to make intuitive sense for the value it displays. You can edit the parameters of the Display block during simulation. The Display block can display complex, vector, and 2-D matrix signals. Use the Display block with other dashboard blocks to build an interactive dashboard of controls and indicators for your model.

Connect Dashboard Blocks

Dashboard blocks do not use ports to connect to model elements. To connect dashboard blocks to signals in your model, use connect mode. Connect mode facilitates the process of connecting dashboard blocks in your model, especially when you want to connect multiple blocks at once. To connect a single dashboard block, you can also use the Connection table in the block dialog box.

Tip

You can modify dashboard block connections during normal and accelerator mode simulations.

To enter connect mode, in the canvas, select the dashboard block to connect. On the Simulink® Toolstrip, a tab named after the type of the selected block appears. On the block tab, click Connect. In connect mode, when you select one or more signals or blocks, a list of signals that are available for connection appears. Select a signal from the list to connect to the selected dashboard block. To connect another dashboard block, pause on the block you want to connect and click the Connect button above it. Then, select one or more signals and blocks in the model and choose a signal to connect.

A Gauge block is in connect mode. To the right of the Gauge block is a Sine Wave block that connects to a Gain block that connects to an Outport block. To the right of the Outport block is the list of signals available for connection.

When you finish connecting the dashboard blocks in your model, on the block tab, click Done Connecting.

Tip

You can hide the message shown on unconnected blocks using the set_param function with the ShowInitialText block parameter. The message also disappears when you connect the block.

Limitations

  • You cannot use the Connection table to connect a dashboard block to a block that is commented out. When you connect a dashboard block to a commented block using connect mode, the dashboard block does not display the connected value until the you uncomment the block.

  • The toolstrip does not support dashboard blocks that are in a panel.

  • Dashboard blocks cannot connect to signals inside referenced models.

  • When you simulate a model hierarchy, dashboard blocks inside referenced models do not update.

  • Dashboard blocks do not support rapid accelerator simulation.

  • You cannot connect a dashboard block to state activity or chart data in Stateflow® during simulation.

  • You cannot programmatically connect a dashboard block to state activity or chart data in Stateflow.

  • Some signals do not have data available during simulation due to block reduction or optimization for accelerator mode simulations. To view such a signal using a dashboard block, mark the signal for logging.

Parameters

expand all

Connection

Use the connection table to select the signal to connect to the block. To connect the block to a signal:

  1. Make a selection in the model that includes one or more signals.

  2. In the table, select the signal you want to connect.

  3. Click Apply.

Tip

You can connect dashboard blocks to signals in the model during simulation.

Programmatic Use

Block Parameter: Binding
Type: Simulink.HMI.SignalSpecification
Default: []

Main

Format for displaying signal values, specified as one of these values:

  • short — Scaled fixed-decimal format with four digits after the decimal point

  • long — Scaled fixed-decimal format with fifteen digits after the decimal point for double values and seven digits after the decimal point for single values

  • shortE — Scientific notation format with four digits

  • longE — Scientific notation format with fifteen digits after the decimal point for double values and seven digits after the decimal point for single values

  • shortG — Data takes the more compact format between fixed-decimal or scientific notation, with a total of five digits

  • longG — Data takes the more compact format between fixed-decimal or scientific notation, with a total of fifteen digits for double values and seven digits for single values

  • shortEng — Engineering notation where the exponent is a multiple of 3, with 4 digits after the decimal point

  • longEng — Engineering notation where the exponent is a multiple of 3, with 15 significant digits

  • + — Positive/negative format. +, -, and blank characters are displayed for positive, negative, and zero values, respectively

  • bank — Currency format with 2 digits after the decimal point

  • hex — Hexadecimal representation

  • rat — Ratio

  • Custom — Custom string format. Data is displayed in a custom string that you specify using the Format String parameter.

  • Integer — Data rounded to the nearest whole number.

Programmatic Use

Block Parameter: Format
Type: character array | string
Values: 'short' | 'long' | 'shortE' | 'longE' | 'shortG' | 'longG' | 'shortEng' | 'longEng' | 'bank' | '+' | 'hex' | 'rat' | 'Custom' | 'Integer'
Default: 'short'

Custom string to format displayed signal data, specified as a string. The format string consists of text and format operators, which start with a % sign and end with a conversion character. Use the format operators at the place in the string where you want the signal data to display. For more information about supported formatting operators, see the formatSpec input of the compose function.

Example: The value of pi is %.2f displays the value of the connected signal within a sentence.

Example: $%.2f displays the value of the connected signal with a dollar sign and two decimal places.

Dependencies

To enable this parameter, set the Format parameter to Custom.

Programmatic Use

Block Parameter: FormatString
Type: character array | string
Default: '%d'

Text alignment in the Display block.

Programmatic Use

Block Parameter: Alignment
Type: character array
Values: 'Left' | 'Center' | 'Right'
Default: 'Center'

Position of the block label. When the block is connected to an element in the model, the label is the name of the connected element.

Programmatic Use

Block Parameter: LabelPosition
Type: character vector
Values: 'Hide' | 'Bottom' | 'Top'
Default: 'Hide'

How to arrange elements of non-scalar data, specified as one of these options:

  • Preserve dimensions — Display elements arranged to match signal dimensions.

  • Fill available space — Display as many elements as possible within available space.

Programmatic Use

Block Parameter: Layout
Type: character array | string
Values: 'Preserve dimensions' | 'Fill available space'
Default: 'Preserve dimensions'

Format

Whether to show a grid on the block when the block displays non-scalar data. Specify the color of the grid using the Grid Color parameter.

Programmatic Use

Block Parameter: ShowGrid
Type: character array | string
Values: 'on' | 'off'
Default: 'on'

Block background opacity, specified as a scalar value between 0 and 1.

Example: 0.5

Programmatic Use

Block Parameter: Opacity
Type: scalar
Default: 1

Block foreground color, including the text. You can select a color from a palette of standard colors or specify a custom color.

Programmatic Use

Specify the ForegroundColor parameter for the block as a string or a character vector that defines a 1-by-3 [r g b] vector with values between 0 and 1.

Block Parameter: ForegroundColor
Type: character vector | string
Values: [r g b] vector

Block background color. You can select a color from a palette of standard colors or specify a custom color.

Programmatic Use

Specify the BackgroundColor parameter for the block as a string or a character vector that defines a 1-by-3 [r g b] vector with values between 0 and 1.

Block Parameter: BackgroundColor
Type: character vector | string
Values: [r g b] vector

Block grid color. The grid shows when the block displays non-scalar data. You can select a color from a palette of standard colors or specify a custom color.

Programmatic Use

Specify the GridColor parameter for the block as a 1-by-3 [r g b] vector with values between 0 and 1.

Block Parameter: GridColor
Type: [r g b] vector
Default: [0.502 0.502 0.502]

Block Characteristics

Data Types

Boolean | double | enumerated | fixed point | half | integer | single | string

Direct Feedthrough

no

Multidimensional Signals

yes

Variable-Size Signals

no

Zero-Crossing Detection

no

Extended Capabilities

Version History

Introduced in R2017b