Create Host Scopes with Simulink Real-Time Explorer

You can create a host scope on the target computer with Simulink® Real-Time™ Explorer. These scopes have the full capabilities of the Scope block in Host mode, but do not persist past the current execution.

For information on using host scope blocks, see Configure Real-Time Host Scope Blocks and Host Scope Usage.

This procedure uses the model ex_slrt_sf_car (open_system(docpath(fullfile(docroot, 'toolbox', 'xpc', 'examples', 'ex_slrt_sf_car')))).

Set Up Model

Before creating a host scope, perform these steps:

  1. Open model ex_slrt_sf_car. Set property Stop time to inf. On the Real-Time tab, select Run on Target > Stop Time and set Stop Time to inf.

  2. Connect to the target computer. On the Real-Time tab, toggle the Disconnected indicator to Connected.

  3. Build and download the real-time application to the target computer. On the Real-Time tab, click Run on Target.

  4. Open Simulink Real-Time Explorer. On the Real-Time tab, click Prepare > SLRT Explorer.

Configure Host Scope

  1. In the Scopes pane, expand the ex_slrt_sf_car node.

  2. To add a host scope, select Host Scopes, and then click the Add Scope button  on the toolbar.

  3. Expand Scope 1, and then click the Properties button  on the toolbar.

    To display the host scope signals, in the Scope Properties pane, click Signals.

  4. In the Applications pane, expand the real-time application node, and then the node Model Hierarchy.

  5. Double-click the ex_slrt_sf_car > transmission > Torque Converter node.

    The Torque Converter signal list opens.

  6. To add signal turbine to Scope1, drag signal turbine from the Torque Converter signal list to the Scope1 properties workspace.

    To make the Scope1 properties visible below the Torque Converter signal list, drag the Torque Converter tab down until the  icon appears.

  7. Double-click transmission ratio and add signal Product to Scope 1 in the same way as described in step 6.

View Host Scope

  1. Select Scope 1, and then click the View Scope button  on the toolbar.

    The host scope viewer opens as a separate tab. The signals that you add to the scope appear at the top right of the viewer. The labels appear in pointed brackets because these signals are labeled signals.

  2. To start Scope 1, click Scope 1 in the Scopes pane, and then click the Start Scope button  on the toolbar.

  3. To start execution, click the real-time application, and then click the Start button  on the toolbar.

    The real-time application starts running. The host scope on the target computer transfers data to the host scope on the development computer.

  4. To stop Scope 1, click Scope 1 in the Scopes pane, and then click the Stop Scope button  on the toolbar.

  5. To stop execution, click the real-time application, and then click the Stop button  on the toolbar.

See Also

Related Topics