Documentation

Floating Scope and Scope Viewer Tasks

Add Floating Scope Block to Model

To add a Floating Scope block from the Simulink® block library:

  1. From the Simulink Editor menu, click the Library Browser button .

  2. From the Simulink Sinks library, drag a copy of the Floating Scope block to the Simulink Editor.

To add a Floating Scope block by searching from the model diagram:

  1. In the Simulink Editor, click the model diagram, and then start typing floating scope.

  2. From the list, select Floating Scope Simulink/Sinks.

Add Scope Viewer with Signal & Scope Manger

  1. From the Simulink Editor menu, select Diagram > Signals & Ports > Signal & Scope Manager.

  2. In the Signal & Scope Manager, in the Types pane and under the Viewers node, expand a product node to show the available viewers.

  3. Select a Scope, and then click Attach to model. The viewer is added to a table on the Viewers tab in the Generators/Viewers in model pane.

Connect Signals to a Floating Scope Block or Scope Viewer

Use the Signal Selector to connect signals to a Floating Scope block or Scope viewer.

  1. Open a Scope window. In a Simulink model, double-click a Floating Scope block or Scope viewer icon .

  2. Open the Signal Selector. On the Scope window toolbar, click the Signal Selector button .

  3. For Scopes with multiple displays, select a display. In the Signal Selector dialog box, select a display from the Select signals for object drop down list.

  4. Select check boxes for the signals you want to view.

  5. Click Close and then run a simulation.

Save Simulation Data Using Floating Scope Block

This procedure uses the model vdp to demonstrate saving signals to the MATLAB® Workspace.

  1. Add a Floating Scope or Scope Viewer to your model. See Add Floating Scope Block to Modelor Add Scope Viewer with Signal & Scope Manger.

  2. Connect signals using the Signal Selector. See Connect Signals to a Floating Scope Block or Scope Viewer. For example, select the signals x1 and x2.

  3. Open a Floating Scope or Scope Viewer window. From the toolbar, click the Parameters button .

  4. Click the Logging tab, and then select the Log/Unlog Viewed Signals to Workspace button.

    This selection also sets the Log signal data parameter check box for the connected signals. The Simulink Editor places logging symbols on the signals.

  5. Open the Configuration Parameters dialog box. From the Simulink Editor menu, select Simulation > Model Configuration Parameters > Data Import/Export.

  6. Select the Signal logging check box. Use the default Dataset object name logsout or enter your own name. Click OK.

  7. Run a simulation. Simulink saves data to the MATLAB Workspace in a Dataset object with two elements, one element for each signal.

  8. In the MATLAB Command Window, enter these commands to view the logged data from logsout, where x1 is the name of a signal:

    x1_data = logsout.get('x1').Values.Data
    x1_time = logsout.get('x1').Values.Time
    plot(x1_time,x1_data)
    

Run Simulation from Floating Scope Window

  1. From a Simulink model, double-click a Floating Scope block.

  2. From the toolbar, click the Run button .

For information on using toolbar buttons to control a simulation, see Step Through a Simulation.

Delete Scope Viewer

  1. Right-click any signal line with a viewer attached or click the viewer symbol attached to a signal line.

  2. Select Delete Viewer, and then select a viewer name.

View Signals on a Floating Scope Quickly

  1. Open a Floating Scope window.

  2. On the toolbar, click the Lock button to unlock the Floating Scope.

    Signals that you connected to this scope using the Signal Selector are removed.

  3. On the model, click a signal line to select and highlight the signal line. To select multiple signals, hold down the Shift key while selecting signals.

  4. Run a simulation.

Connect Scope Viewers Without Using Signal Selector

  1. Right-click a signal line.

  2. Select Create & Connect Viewer > Simulink > Scope.

    The selected signal connects to the Scope Viewer, and a viewer symbol is added to the signal line.

Connect additional signals using the Signal Selector. See .

See Also

| |

Related Examples

Was this topic helpful?