Main Content

Dashboard Scope

Trace signals during simulation

  • Library:
  • Simulink / Dashboard

  • Dashboard Scope block

Description

The Dashboard Scope block shows connected signals during simulation on a scope display. You can use the Dashboard Scope block with other Dashboard blocks to build an interactive dashboard of controls and indicators for your model. The Dashboard Scope block provides a complete picture of signal behavior over the course of the simulation. Use the Dashboard Scope block to display signals of any data type that Simulink® supports, including enumerated data types. The Dashboard Scope block can display up to eight signals from an array or bus.

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. If you only want 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, select a dashboard block to connect and then, on the block tab, click Connect. In connect mode, when you select one or more signals, a list of signals that are available for connection appears. Select a signal from the list to connect the signal 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 in the model and choose a signal to connect.

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.

Data Cursors

You can add data cursors to a Dashboard Scope block to inspect the displayed signals. The data cursors show when the Dashboard Scope block is selected. With the Dashboard Scope block selected, you can move cursors along the displayed signals to see the data values that correspond to each time sample. When you display two cursors, a box between the cursors along the time axis displays the time difference between the two cursors.

To add data cursors, right-click the Dashboard Scope block. Under the Data Cursors menu, select the number of cursors you want to add.

Zoom, Pan, and Fit to View

You can also use zoom, pan, and fit-to-view actions to inspect your signals. You can restrict the zoom and fit-to-view actions to change the plot limits for only the t-axis or only the y-axis. To zoom, pan, or fit to view, right-click the Dashboard Scope block and select an action.

  • Pan

  • Zoom In

  • Zoom in Time

  • Zoom in Y

  • Zoom Out

  • Fit to View

  • Fit to View in Time

  • Fit to View in Y

Signal Appearance

You can modify the color and line style for signals connected to a Dashboard Scope block from the Connection table in the block dialog box. To modify the appearance of a connected signal:

  1. Click the signal appearance preview for the signal in the Style column of the Connection table.

  2. Choose a signal color from the palette of standard colors or specify a custom color using RGB values between 0 and 255.

  3. Select the line style from the solid, dotted, dashed, and dot-dashed options under the Style section in the signal appearance dialog.

Signal color and line style remain consistent for a signal throughout a model. You can configure the line style and color for a signal through the Instrumentation Properties for a logged signal and through the Dashboard Scope block dialog of a Dashboard Scope block connected to the signal. The Override style and color setting is selected by default and controls whether signal appearance options chosen through that Dashboard Scope block dialog box override signal appearance options configured elsewhere in the model. When you clear the Override style and color setting, changes made using the dialog box for that Dashboard Scope block are not applied.

When you connect signals to a Dashboard Scope block using the block dialog box, the connection table shows the default signal color and line style used for a signal you connect. As you check signals to connect, the Connection table updates the default style and color to be used for the next signal you connect from the remaining signals in the selection.

Complex Signals

The Dashboard Scope block displays complex signals according to their Complex Format. You can configure the Complex Format for a signal using the Instrumentation Properties dialog, accessible when you right-click the logging badge for the signal and select Properties.

A signal can have a Complex Format that is:

  • Real-Imaginary

  • Magnitude-Phase

  • Magnitude

  • Phase

When you set the Complex Format for a signal to Real-Imaginary or Magnitude-Phase, the Dashboard Scope block displays both components of the signal. The real or magnitude component displays in the color indicated in the Connection table. The imaginary or phase component displays in a different shade of the color indicated in the Connection table.

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 data or activity in Stateflow® during simulation.

  • Some signals are removed by optimization and are not available during accelerator mode simulations. To view such a signal using a dashboard block, mark the signal for logging.

Parameters

expand all

Connection

Select one or more signals to connect using the Connection table. Populate the Connection table by selecting signals of interest in your model. Select the check box next to the signal you want to display. Click Apply to connect the signal. To facilitate understanding and debugging your model, you can connect signals to a Dashboard Scope block during simulation.

You can also configure the line style and color for signals connected to a Dashboard Scope block using the Connection table. For more information, see Signal Appearance.

Programmatic Use

To programmatically specify one or more signals to connect to the Dashboard Scope block, use a cell array of Simulink.HMI.SignalSpecification objects.

Block Parameter: Binding
Type: cell array of Simulink.HMI.SignalSpecification objects
Default: []

To programmatically configure the line style and color for connected signals, use the Colors parameter. Specify the value for the Colors parameter as an array of structures, where each structure specifies the line style and color for one signal. Settings specified using the Colors parameter apply to the signal at the same index in the value for the Binding parameter.

Specify the line style and color for each signal as a structure with the fields:

  • Color1-by-3 [r g b] vector with values between 0 and 1 specifying the signal color.

  • LineStyle — Character vector specifying one of these line style options:

    • Solid: '-'

    • Dashed: '––'

    • Dotted: ':'

    • Dash-dotted: '-.'

sig1Colors.Color = [0 0 1];
sig1Colors.LineStyle = '--';
sig2Colors.Color = [1 0 1];
sig2Colors.LineStyle = '-';
sigColors = [sig1Colors sig2Colors];
Block Parameter: Colors
Type: array of structures

Main

A finite, real, double, scalar value that sets the time span of the plot.

When Time Span is set to auto, the block sets its time span to the model's simulation stop time.

Tips

When you set the Time Span to a value that is less than the duration of the simulation, use the Update Mode parameter to control whether the display wraps or scrolls when the simulation time exceeds the specified time span.

Programmatic Use

Block Parameter: TimeSpan
Type: string | character array
Values: 'auto' or numeric value
Default: 'auto'

How the display updates during simulation, specified as Wrap or Scroll.

  • Wrap — Display wraps to show incoming data after simulation time reaches end of time span.

  • Scroll — Display scrolls to show incoming data after simulation time reaches end of time span.

Programmatic Use

Block Parameter: UpdateMode
Type: string | character array
Values: 'Wrap' | 'Scroll'
Default: 'Wrap'

A finite, real, double, scalar value that sets the minimum of the vertical axis.

Dependencies

The Min value must be less than the Max value.

Programmatic Use

To specify the Min parameter for the Dashboard Scope block programmatically, use a 1-by-2 vector containing the minimum y-axis value and maximum y-axis value, in that order.

Block Parameter: YLimits
Type: 1x2 vector
Default: [-3 3]

A finite, real, double, scalar value that sets the maximum of the vertical axis.

Dependencies

The Max value must be greater than the Min value.

Programmatic Use

To specify the Max parameter for the Dashboard Scope block programmatically, use a 1-by-2 vector containing the minimum y-axis value and maximum y-axis value, in that order.

Block Parameter: YLimits
Type: 1x2 vector
Default: [-3 3]

When on, normalizes the connected signal data for display on a y-axis range of [0,1].

Programmatic Use

Block Parameter: NormalizeYAxis
Type: string | character vector
Values: 'on' | 'off'
Default: 'off'

When on, performs a fit-to-view operation on the data displayed in the plot when the simulation stops.

Programmatic Use

Block Parameter: ScaleAtStop
Type: string | character vector
Values: 'on' | 'off'
Default: 'on'

When on, shows instructional text if the block is not connected. When the block is not connected, you can specify this parameter as off to hide the text.

Programmatic Use

Block Parameter: ShowInitialText
Type: string | character vector
Values: 'on' | 'off'
Default: 'on'

Display

Axes tick positions, specified as Outside, Inside, or None.

  • Outside — Ticks are drawn on the outside of the x- and y-axes.

  • Inside — Ticks are drawn on the inside of the x- and y-axes.

  • None — No ticks are shown on the x- or y-axes.

Programmatic Use

Block Parameter: TicksPosition
Type: string | character vector
Values: 'Outside' | 'Inside' | 'None'
Default: 'Outside'

Visibility of tick labels on the x- and y-axes.

  • All — Ticks labels are shown on the x- and y-axes.

  • T-Axis — Tick labels are shown on the x-axis only.

  • Y-Axis — Tick labels are shown on the y-axis only.

  • None — No tick labels are shown on the x- or y-axis.

Programmatic Use

Block Parameter: TickLabels
Type: string | character vector
Values: 'All' | 'T-Axis' | 'Y-Axis' | 'None'
Default: 'All'

You can position the legend at the top of the plot, inside or outside the plot area or on the right of the plot, inside or outside the plot area. You can also hide the legend. The legend shows the color chosen for each connected signal next to the signal name.

Programmatic Use

Block Parameter: LegendPosition
Type: string | character vector
Values: 'Top' | 'Right' | 'InsideTop' | 'InsideRight | 'Hide'
Default: 'Top'

Visibility of horizontal grid lines.

  • on — Horizontal grid lines are visible on Dashboard Scope.

  • off — Horizontal grid lines are not shown on Dashboard Scope.

Programmatic Use

Block Parameter: Grid
Type: string | character vector
Values: 'All' | 'Horizontal' | 'Vertical' | 'None'
Default: 'All'

Visibility of vertical grid lines.

  • on — Vertical grid lines are visible on Dashboard Scope.

  • off — Vertical grid lines are not shown on Dashboard Scope.

Programmatic Use

Block Parameter: Grid
Type: string | character vector
Values: 'All' | 'Horizontal' | 'Vertical' | 'None'
Default: 'All'

Plot border visibility.

  • on — Plot border is shown on Dashboard Scope.

  • off — Plot border is not shown on Dashboard Scope.

Programmatic Use

Block Parameter: Border
Type: string | character vector
Values: 'on' | 'off'
Default: 'on'

Signal data marker visibility.

  • on — Data markers are shown for signals plotted on Dashboard Scope.

  • off — Data markers are not shown for signals plotted on Dashboard Scope.

Programmatic Use

Block Parameter: Markers
Type: string | character vector
Values: 'on' | 'off'
Default: 'off'

Style

Color of grid lines. 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 1-by-3 [r g b] vector with values between 0 and 1.

Block Parameter: ForegroundColor
Type: [r g b] vector

Color of plot area. 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 1-by-3 [r g b] vector with values between 0 and 1.

Block Parameter: BackgroundColor
Type: [r g b] vector

Color of ticks and tick labels. You can select a color from a palette of standard colors or specify a custom color.

Programmatic Use

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

Block Parameter: FontColor
Type: [r g b] vector

Block Characteristics

Data Types

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

Direct Feedthrough

no

Multidimensional Signals

yes

Variable-Size Signals

no

Zero-Crossing Detection

no

Extended Capabilities

Introduced in R2015a