Web Browser Interface

The Simulink® Real-Time™ software includes a web server that allows you to interact with your real-time application through a web browser running on a development computer.

    Note:   In R2017a, the web interface to the target application will cease to function. Use Simulink Real-Time Explorer instead.

You access the web browser through an Ethernet connection using the Simulink Real-Time web server.

Connecting the Web Interface Through TCP/IP

If your development computer and target computer are connected with a network cable, you can connect the real-time application on the target computer to a web browser on the development computer.

The TCP/IP stack on the Simulink Real-Time kernel supports only one simultaneous connection, because its main objective is real-time applications. This connection is shared between the MATLAB® interface and the web browser. This shared connection means that only one browser or the MATLAB interface can connect at one time. Close the other connections to the target computer. For example, if you are currently connected to the target computer through Simulink Real-Time Explorer, right-click that target computer icon and select Disconnect or click the Disconnect button   on the toolbar.

Before you connect your web browser on the development computer, load a real-time application onto the target computer. The real-time application does not have to be running, but it must be loaded. Also, your browser must have JavaScript® and style sheets turned on.

  1. In the Command Window, type


    The MATLAB interface is disconnected from the target computer, and the connection is reset for connecting to another client. If you do not use this command immediately before opening the web interface, your browser might not be able to connect to the target computer.

  2. Open a web browser. In the address box, enter the IP address and port number you entered in Simulink Real-Time Explorer. For example, if the target computer IP address is and the port is 22222, type:

    The browser loads the Simulink Real-Time web interface frame and panes.

Using the Main Pane

The Main pane is divided into four parts, one below the other. The four parts are System Status, Simulink Real-Time Properties, Navigation, and WWW Properties.

After you connect a web browser to the target computer, you can use the Main pane to control the real-time application:

  1. In the left frame, click the Refresh button.

    System status information in the top cell is uploaded from the target computer. If the right frame is either the Signals List pane or the Screen Shot pane, updating the left frame also updates the right frame.

  2. Click the Start Execution button.

    The real-time application begins running on the target computer, the Status line is changed from Stopped to Running, and the Start Execution button text changes to Stop Execution.

  3. Update the execution time and average task execution time (TET). Click the Refresh button. To stop the real-time application, click the Stop Execution button.

  4. Enter new values in the StopTime and SampleTime boxes, then click the Apply button. You can enter -1 or Inf in the StopTime box for an infinite stop time.

    The new property values are downloaded to the real-time application. Note that the SampleTime box is visible only when the real-time application is stopped. You cannot change the sample time while a real-time application is running. (See Alternative Configuration and Control Methods for limitations on changing sample times.)

    After entering values, the screen looks like this:

Changing WWW Properties

The WWW Properties cell in the left frame contains fields that control the display on the web interface itself, and not the real-time application. There are two fields: maximum signal width to display and refresh interval.

  1. In the Maximum Signal Width box enter -1, Inf (show all signals), 1 (show only scalar signals), 2 (show scalar and vector signals less than or equal to 2 wide), or n (show signals with a width less than or equal to n).

    Signals with a width greater than the value you enter are not displayed on the Signals pane.

  2. In the Refresh Interval box, enter a value greater than 10. For example, enter 20.

    The signal pane updates automatically every 20 seconds. Entering -1 or Inf does not automatically refresh the pane.

Sometimes, both the frames try to update simultaneously, or the auto refresh starts before the previous load has finished. This problem can happen with slow network connections. In this case, increase the refresh interval or manually refresh the browser (set the Refresh Interval = Inf).

This can also happen when you are trying to update a parameter or property at the same time that the pane is automatically refreshing.

Sometimes, when a race condition occurs, the browser becomes confused about the format, and you might have to refresh it. This should not happen often.

Monitor Signals with a Web Browser

The Signals pane is a list of the signals in your model.

After you connect a web browser to the target computer you can use the Signals pane to view signal data:

  1. In the left frame, click the Signals button.

    The Signals pane is loaded in the right frame with a list of signals and the current values.

  2. On the Signals pane in the right frame, click the Refresh button.

    The Signals pane is updated with the current values. Vector/matrix signals are expanded and indexed in the same column-major format that the MATLAB interface uses. This can be changed by the Maximum Signal Width value you enter in the left frame.

  3. In the left frame, click the Screen Shot button.

    The Screen Shot pane is loaded and a copy of the current target computer screen is displayed. The screen shot uses the portable network graphics (PNG) file format.

Trace Signals with a Web Browser

The web browser interface allows you to visualize data using a user interface.

After you connect a web browser to the target computer, you can use the scopes page to add, remove, and control scopes on the target computer:

  1. In the left frame, click the Scopes button. The browser loads the Scopes List pane into the right frame.

  2. Click the Add Scope button.

    A target scope is created and displayed on the target computer. The Scopes pane displays a list of the scopes present. You can add a scope, remove existing scopes, and configure the scopes from this page.

    To create a host scope, use the drop-down list next to the Add Scope button to select Host. This item is set to Target by default.

  3. Click the Edit button.

    From the scope editing pane, you can configure and control the scope.

  4. Click the Add Signals button. The browser displays an Add New Signals list.

  5. Select the check boxes next to the signal names, and then click Apply. A Remove Existing Signals list is added above the Add New Signals list.

You do not have to stop a scope to change scope parameters. If the scope is running, the web interface stops the scope automatically and then restarts it when the changes are made. It does not restart the scope if the state was originally stopped.

The Get Data button becomes available under these circumstances:

  • The host scope is stopped (Scope State is set to Interrupted)

  • The host scope finishes one cycle of acquisition (Scope State is set to Finished).

If you click the Get Data button, the scope data is retrieved in comma-separated value (CSV) format. The signals in the scope are spread across columns. Each row corresponds to one sample of acquisition. The first column corresponds to the time each sample was acquired.

If Scope State is set to Interrupted, the scope was stopped before it completed a full cycle of acquisition. The number of rows in the CSV data still correspond to a full cycle. The last few rows (for which data was not acquired) are set to 0.

Log Signals with a Web Browser

When you stop the model execution, you see another section of the web browser interface where you can download logging data. This data is in comma-separated value (CSV) format. The MATLAB interface reads CSV format using the dlmread function. Most spreadsheet programs can read CSV format files.

You see this section of the web browser interface only if you have enabled data logging. Buttons become available only for those logs (states, output, and TET) that are enabled. If time logging is enabled, the first column of the CSV file is the time at which data (states, output, and TET values) was acquired. If time logging is not enabled, only the data is in the CSV file, without time information.


    • The data logging variables tout, xout, yout, and logsout are available only when you use Simulink to simulate the model in non-real-time.

    • You cannot use Simulink Data Inspector to create a data log on the target computer. You can log only signals that are connected to an Outport block.

You plot the outputs and states of your real-time application to observe the behavior of your model with different input signal values and parameter settings.

To do data logging, first carry out the following setup.

  1. Click Simulation > Model Configuration Parameters.

  2. To allow Simulink to log signals, in the Data Import/Export pane, verify that the Signal logging check box is selected. This check box is selected by default.

  3. To plot the task execution time, in the Simulink Real-Time Options pane, verify that the Log Task Execution Time check box is selected. This check box is selected by default.

  4. In the Simulink Real-Time Options pane of the Configuration Parameters dialog box, set Signal logging buffer size in doubles to a value large enough to accommodate the number of signals you are logging.

Task Execution Time (TET) measures how long it takes the kernel to run for one base-rate time step. For a multirate model, use the profiler to find out what the execution time is for each rate.

Tune Parameters with a Web Browser

The Parameters pane displays the tunable parameters in your model. Row and column indices for vector/matrix parameters are also shown.

After you connect a web browser to the target computer, use the Parameters page to change parameters in your real-time application while it is running.

  1. In the left frame, click Parameters. The browser loads the Parameter List pane into the right frame.

    If the parameter is a scalar parameter, the current parameter value is shown in a box that you can edit.

    If the parameter is a vector or matrix, click the Edit button to view the vector or matrix. You can edit the parameter in this pane.

  2. In the Value box, enter a new parameter value, and then click the Apply button.

    The new parameter values are uploaded to the real-time application.

Changing Access Levels to the Web Browser

The web browser interface allows you to set access levels to the real-time application. The different levels limit access to the real-time application. The highest level, 0, is the default level and allows full access. The lowest level, 4, only allows signal monitoring and tracing with your real-time application.

  1. In Simulink Editor, click Simulation > Model Configuration Parameters.

    The Configuration Parameters dialog box for the model is displayed.

  2. Click the Code Generation node.

    The code generation pane opens.

  3. In the Target selection section, access levels are set in the System target file box. For example, to set the access level to 1, enter

    slrt.tlc -axpcWWWAccessLevel=1

    If you do not specify -axpcWWWAccessLevel, the highest access level (0) is set.

  4. Click OK.

The various fields disappear, depending on the access level. For example, if your access level does not allow you access to the parameters, you do not see the button for parameters.

There are various access levels for monitoring, which allow different levels of hiding. The proposed setup is described below. Each level builds on the previous one, so only the incremental hiding of each successive level is described.

Level 0 — Full access to the panes and functions.

Level 1 — Cannot change the sample and stop times. Cannot change parameters, but can view parameters.

Level 2 — Cannot start and stop execution of the real-time application or log data.

Level 3 — Cannot view parameters. Cannot add new scopes, but can edit existing scopes.

Level 4 — Cannot edit existing scopes on the Scopes pane. Cannot add or remove signals on the Scopes pane. Cannot view the Signals pane and the Parameters pane, and cannot get scope data.

Was this topic helpful?