Main Content

Create a Realistic Dashboard Using Blocks from the Customizable Blocks Library

Using blocks from the Customizable Blocks library, you can create a dashboard of displays and controls for your model that looks like a real system. This example model uses four Circular Gauge blocks and two Display blocks to create a dashboard for the sf_car model like one you might see in a real car.

The blocks are in a panel with a background that looks like a real car dashboard. For information about panels, see Getting Started with Panels.

Explore Dashboard

The blocks in the panel are display blocks, meaning they display the values of the signals to which they are connected. You can explore the relationship between the dashboard and the model by jumping from any block in the panel to the connected signal. To jump from blocks to their connected signals, the panel must be unlocked. By default, when a panel is open in its own window, the panel is locked. In the toolstrip of the panel window, click the Unlock Panel button.

Position the model and panel windows such that you can see both simultaneously. Select a block on the dashboard. Pause on the ellipsis (...) that appears. In the action bar that expands, click Jump to Connected Element. The model navigates to where the connected signal exists and briefly highlights the signal. Repeat these steps for the other blocks to see how they connect to the model.

The Circular Gauge block on the left displays the Vehicle Speed signal, acting as a speedometer on the dashboard. The appearance of the block is customized. The scale limits have been changed from those of the default Circular Gauge block. When you simulate the model, an orange value bar helps indicate the gauge value.

To create this gauge, add a Circular Gauge block from the Customizable Blocks library to your model and enter design mode. To enter design mode, select the block, pause on the ellipsis that appears over the block, and in the action bar that expands, click Edit Custom Block. In the toolbar that appears, click Open Design Tab. In the Property Inspector, on the Design tab, adjust the scale limits and value bar color. When you finish, exit design mode by clicking the X in the upper right corner of the canvas. For more information about how to customize Circular Gauge blocks, see Circular Gauge. To check your work, open CarDashboardModel.slx, select the speedometer, open the Design Tab of the Property Inspector, and compare the parameter values with those of the block you created.

The Circular Gauge blocks at the top of the model display the Throttle and Brake signals. To create these gauges, add two Circular Gauge blocks to your model. For each, enter design mode, and on the Design tab of the Property Inspector, delete the background image and needle image. Then, adjust the scale arc, scale limits, and value bar color. When you finish, exit design mode.

The Circular Gauge block on the right displays the Engine RPM signal on a custom gauge face. To create a gauge like this one, add a Circular Gauge block to your model, and enter design mode. On the Design tab of the Property Inspector, delete the background image and upload car-dashboard-tachometer-gauge-background.png or your own image. When you finish, exit design mode.

The Display block at the bottom of the dashboard displays the Gear signal using seven segment numbers. To create this display, add a Display block from the Customizable Blocks library to your model. Enter design mode. On the Design tab of the Property Inspector, switch to using a custom background color instead of a background image. Select the display font DSEG7 Classic, the font size 72, the font color turquoise, and the font style bold. When you finish, exit design mode. For more information about how to customize a Display block, see Display.

The Display block at the top of the dashboard displays which vehicle maneuver is being simulated. The block connects to the Maneuver signal. To create this display, add a Display block from the Customizable Blocks library to your model. Enter design mode. On the Design tab of the Property Inspector, switch to using a custom background color instead of a background image. Select the display font Roboto, the font size 14, and the font color gray. When you finish, exit design mode.

Try creating the blocks. Then, connect the blocks, promote the blocks to a panel, and change the panel background to look like a real car dashboard.

To connect a dashboard block to a signal, select or pause your pointer on the block. Click the Connect button above the block. Click the signal line. Select the signal to which you want to connect the block. Click the Done Connecting button above the block. For information about connecting dashboard blocks, see Connect Dashboard Blocks to Simulink Model.

To promote blocks you create to a panel, select the blocks. Pause on the ellipsis that appears. In the action bar that expands, click Promote to Panel.

To give the panel a custom background, select the panel. Pause on the ellipsis that appears. In the action bar that expands, click Edit Panel. The action bar options change. In action bar, click Change Background Image. Select car-dashboard-panel-background.png, or your own image. Then, in the action bar, click Done Editing.

To move the panel into a separate window, select the panel. Pause on the ellipsis that appears. In the action bar that expands, click Open in New Window.

Choose Vehicle Maneuver to Simulate

You can simulate four different vehicle maneuvers:

  • Coasting

  • Gradual acceleration

  • Hand braking

  • Passing maneuver

Before you run the simulation, choose a maneuver. Open the Vehicle Maneuver tab of the panel by clicking the tab name at the top of the panel. Then, click the Callback Button block with the name of the maneuver you want to simulate.

Monitor System During Simulation

Return to the Dashboard tab by clicking the tab name at the top of the panel.

To run the simulation, in the toolstrip at the top of either the window containing the model or the window containing the dashboard, press the play button. In the window containing the dashboard, watch the gauge needles move and the gear numbers change.

See Also

Blocks

Topics