Main Content

Deploy Dashboard Panel as App

You can deploy a dashboard panel, packaged with the connected model, as a standalone desktop app or a web app. You can use the app to operate the controls and monitor the displays on the panel independent of Simulink®.

The panel is visible in the app, and you can interact with the panel. From the app, you can start, pause, and stop the simulation. The connected model is not visible. You can only interact with the model through the panel.

Install Software Requirements

Deploying a dashboard panel requires the Simulink Compiler™ and the MATLAB® Compiler.

Running the standalone app requires MATLAB Runtime. For information on how to install MATLAB Runtime, see Download and Install MATLAB Runtime (MATLAB Compiler).

Running the web app requires the MATLAB Web App Server™. For information on how to install and start the MATLAB Web App Server, see Install or Uninstall MATLAB Web App Server Product (MATLAB Web App Server).

Check Deployment Limitations

These actions are not supported:

  • Deployment from MATLAB Online™

  • Deployment from a library model

  • Deployment of a panel that contains any of these blocks:

    • Dashboard Scope blocks

    • Callback Button blocks

    • Display blocks connected to a multidimensional signal

  • Deployment of a panel in a model that does not run in rapid accelerator mode.

    To check whether the model runs in rapid accelerator mode, in the Simulink Toolstrip, on the Simulation tab, in the Simulate section, from the drop-down list, select Rapid Accelerator. Then, click Run. To make the panel deployable, resolve any errors the simulation throws.

    Note

    Blocks from the Dashboard and Customizable Blocks libraries do not support streaming in rapid accelerator mode. The blocks being marked as unsupported during this process is not an error you need to resolve in order to make the panel deployable.

  • Deployment of a model with dependencies that are not on the MATLAB path and whose file path does not share a root with the model. For example, on Windows®, if a dependency is not on the MATLAB path and is located on a different drive than the model, the model is unable to deploy. If you have a dependency that is not on the MATLAB path and whose file path does not share a root with the model, try moving the dependency onto the MATLAB path. If the file path of the dependency is hardcoded in the model, update the path to reflect the new location of the dependency.

Plan Ahead to Avoid Simulation Errors

Deploying a panel creates a copy of the connected model, loads the copy, and then closes the copy. If the model has any callbacks that execute when you load and then close the model, those callbacks run during deployment. Depending on the callback functions, if you try to simulate the original model after the deployment process, you might get an error.

For example, if the model contains a callback that clears variables from the MATLAB workspace when the model closes, then during the deployment, when the copy of the model closes, the callback runs and clears the variables. Since the variables are the same for both the original model and the copy, if you then try to simulate the original model, the model might throw an error because the callback cleared the variables that the model needs to run.

If you plan to simulate the original model after you deploy, adjust the callbacks, the model, or your workflow after deployment to avoid errors during simulation. For example, depending on the model and the callbacks, you might be able to avoid simulation errors by closing and reopening the model after you deploy.

Deploy Panel as Standalone App

You can deploy a panel as a standalone app and run it from an executable.

Deploy Panel

  1. If the model to which the panel connects is not open, open the model.

  2. If you docked the panel or opened the panel in a new window, return the panel to the canvas by clicking the Open in canvas button .

  3. If the model has unsaved changes, save the model.

  4. By default, the app title is the name of the panel you deploy. To change the app title, select the panel. In the Property Inspector, on the Parameters tab, expand the Deployment Settings section. In the App Title text box, enter a new app title.

    In the Parameters tab of the Property Inspector, in the App Title text box, the name myApp is entered.

  5. Also by default, the app deploys to the current folder. Deploying to the current folder means that the software saves all files output during simulation to the current folder. Specifically, in the current folder, the software creates a subfolder named after the app. The software saves all temporary files output during deployment in the current folder, and all non-temporary files in the subfolder. If you plan to deploy to the current folder, check that the current folder has write permissions. If the folder does not have write permissions, navigate to a folder that has write permissions.

    To change the deployment folder, select the panel. In the Property Inspector, on the Parameters tab, in the Deployment Settings section, enter a new file location in the Output Folder text box. Alternatively, click Browse and select a new file location.

  6. To start the deployment, select the panel you want to deploy. In the Simulink Toolstrip, on the Panels tab, in the Share section, expand Deploy Panel and select Standalone Desktop App.

  7. In the Configure Standalone App for Sharing window, click Package.

    Package button in the Configure Standalone App for Sharing window

  8. In the Standalone App Packaging Process window, click Open Output Folder.

    Open Output Folder button in the Standalone App Packaging Process window

Run App

To run the app, in the folder to which you deployed, navigate into the folder with the same name as the app title, then into the release folder, and then into the build folder. Run the executable in the build folder (on Linux®, run the shell script, and on macOS, run the application).

To run the app like other apps on your operating system, install the app on your system. Navigate into the folder with the same name as the app title, then into the release folder, and then into the package folder. Run the executable in the package folder.

Panel containing two Rocker Switch blocks, two Lamp blocks, and a Circular Gauge block deployed as a standalone app

Deploy Panel as Web App

You can deploy a panel as a web app and run the app in a Chrome® browser.

Deploy App

  1. To deploy a panel as a web app, you must deploy on the operating system that supports the server you want to deploy to. For example, if you want to deploy to a Linux Web App server, you must deploy on Linux.

    On the chosen operating system, if the model to which the panel connects is not open, open the model.

  2. If you docked the panel or opened the panel in a new window, return the panel to the canvas by clicking the Open in canvas button .

  3. If the model has unsaved changes, save the model.

  4. By default, the app title is the name of the panel you deploy. To change the app title, select the panel. In the Property Inspector, on the Parameters tab, expand the Deployment Settings section. In the App Title text box, enter a new app title.

    In the Parameters tab of the Property Inspector, in the App Title text box, the name myApp is entered.

  5. Also by default, the app deploys to the current folder. Deploying to the current folder means that the software saves all files output during simulation to the current folder. Specifically, in the current folder, the software creates a subfolder named after the app. The software saves all temporary files output during deployment in the current folder, and all non-temporary files in the subfolder. If you plan to deploy to the current folder, check that the current folder has write permissions. If the folder does not have write permissions, navigate to a folder that has write permissions.

    To change the deployment folder, select the panel. In the Property Inspector, on the Parameters tab, in the Deployment Settings section, enter a new file location in the Output Folder text box. Alternatively, click Browse and select a new file location.

  6. To start the deployment, select the panel you want to deploy. In the Simulink Toolstrip, on the Panels tab, in the Share section, expand Deploy Panel and select Web App.

  7. In the Configure Web App for Sharing window, click Package.

    Package button in the Configure Standalone App for Sharing window

  8. In the Web App Packaging Process window, click Open Output Folder.

    Open Output Folder button in the Web App Packaging Process window

Run App

Start the web app server. For information about how to complete this action, see Install or Uninstall MATLAB Web App Server Product (MATLAB Web App Server).

For information about how to run the web app, see Run Web App (MATLAB Web App Server). Run the web app in a Chrome browser.

Run Simulation from Panel

You can take these actions using the toolbar in the app.

ActionToolstrip Button
Run simulation.Run button
Pause simulation.Pause button
Stop simulation.Stop button
Set simulation pacing. For more information about simulation pacing, see Simulation Pacing Options. Setting simulation pacing is not supported during simulation.Simulation Pacing button

See Also

Topics