Main Content

Create a Realistic Dashboard Using the Circular Gauge Block

Using blocks from the Customizable Blocks library, you can create a dashboard of controls and indicators for your model that looks like a real system. This example model uses four Circular Gauge blocks and a MultiStateImage block 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 dashboard. Panels float above the model canvas and follow you through the model hierarchy. To view the model diagram underneath the panel, grab the panel name or any part of the panel where there are no blocks and drag the panel to one side of the model window. Alternatively, minimize the panel by double-clicking it. To restore the panel, double-click the minimized panel. For information about panels, see Getting Started with Panels.

Explore the Model

To understand the connections between the controls and indicators and the model, you can select each block and jump to the signal it displays in the model. To jump to the connected signal, first move the panel so that you can see both the dashboard block and the model diagram. Then, select a block.

For example, select the speedometer gauge on the left. Click the Gauge tab that appears in the Simulink® Toolstrip and then click Show Connection. The model navigates to where the connected signal exists and briefly highlights the signal.

The Circular Gauge block on the left displays the Vehicle Speed signal, acting as a speedometer on the dashboard. The block uses the default Circular Gauge appearance and a value arc you can see when you simulate the model.

The Circular Gauge blocks at the top of the model display the Throttle and Brake signals. You can create this type of gauge by deleting the background image and needle image from the default Circular Gauge. Then, adjust the scale arc and select colors for the tick marks, scale, and value arc. For more information about how to customize a Circular Gauge block, see Circular Gauge.

The Circular Gauge block on the right displays the Engine RPM signal on a custom gauge face. You can create a gauge like this by deleting the background image in the default Circular Gauge and uploading your own.

The MultiStateImage block on the bottom displays the Gear signal using seven segment display style number images that correspond to the value of the Gear signal. For information about how to add images to a MultiStateImage block, see MultiStateImage.

Monitor System During Simulation

You can use the dashboard to monitor the system response during simulation. The User Inputs block includes several simulation inputs representing different vehicle maneuvers.

Take these steps to change the simulation input.

  1. Navigate to the top level of the model.

  2. Select the Callback Button block labeled with the vehicle maneuver you want to run. When the simulation is not running, selecting the block activates the block so that you can interact with the button.

  3. Click the Callback Button block. Clicking the active block runs a callback function that changes the selected vehicle maneuver in the User Inputs block.

Alternatively, navigate to the top level of the model and open the User Inputs block. You can use the drop-down menu to choose the vehicle action for the model to simulate. Choose among a passing maneuver, gradual acceleration, hard braking, and coasting.

To monitor the system response during simulation, in the toolstrip at the top of either the window containing the model or the window containing the dashboard, press the play button to simulate the model.

See Also

Blocks

Related Topics