Create Target Scopes with Simulink Real-Time Explorer

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


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

This procedure uses the model xpcosc. You must have already completed the following setup:

  1. Built and downloaded the real-time application to the target computer using Simulink ( on the toolbar).

  2. Run Simulink Real-Time Explorer (Tools > Simulink Real-Time).

  3. Connected to the target computer in the Targets pane ( on the toolbar).

  4. Set property Stop time to inf in the Applications pane ( on the toolbar).

To configure a target scope:

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

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

    The new scope appears under node Target Scopes, for example Scope 1.

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

  4. In the Scope Properties workspace, click Signals. You add signals from the Applications Signals workspace.

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

  6. Select the model node and then click the View Signals button  on the toolbar.

    The Signals workspace opens, showing a table of signals with properties and actions.

  7. In the Signals workspace, to add signal Signal Generator to Scope1, drag signal Signal Generator to the Scope1 properties workspace.

  8. Add signal Integrator1 to Scope 1 in the same way.

    The dialog box looks like this figure.

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

    The application starts running. No output appears on the target computer monitor.

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

    Output for signals Signal Generator and Integrator1 appears on the target computer monitor.

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

    The signals shown on the target computer stop updating while the real-time application continues running. The target computer monitor displays a message like this message:

    Scope: 1, set to state 'interrupted'
  12. To stop execution, click the real-time application and then click the Stop button  on the toolbar.

    The real-time application on the target computer stops running, and the target computer displays messages like these messages:

    minimal TET: 0.0000006 at time 0.001250
    maximal TET: 0.0000013 at time 75.405500

    The target computer screen looks like this figure.

You can create a target scope from the scope types list by clicking Add Scope next to scope type Target Scopes. You can add or remove signals from a target scope while the scope is either stopped or running.

To make both workspaces visible at the same time, drag one workspace tab down until the  icon appears in the middle of the dialog box. Continue to drag the workspace until the cursor reaches the required quadrant, and then release the mouse button.

To save your Simulink Real-Time Explorer layout, click File > Save Layout. In a later session, you can click File > Restore Layout to restore your layout.

See Also

Related Topics