Documentation

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

Scope Blocks and Scope Viewer Overview

Overview of Methods

Simulink® scopes provide several methods for displaying simulation data and capturing the data for later analysis. Symbols on your block diagram represent the various data display and data capture methods.

For more information about these methods:

Simulink Scope Versus Floating Scope

Scope blocks and Floating Scope blocks both display simulation results, but they differ in how you attach signals and save data. Simulation behavior for a Floating Scope and a Scope Viewer is identical, but you manage them differently in your model.

CapabilitySimulink ScopeSimulink Floating ScopeSimulink Scope Viewer
Attaching signalsConnect signal lines to a Scope block using input ports.

Attach signals using the Signal Selector. See Signal Selector.

Attach signals interactively from the model before and during a simulation. See View Signals on a Floating Scope Quickly.

Attach signals using the Signal Selector or signal line context menu.
Access to signalsBecause signals lines are connected to a Scope block, access signals at different levels of a model hierarchy using GoTo blocks.

Because signals are attached without signal lines, you do not have to route lines to a Floating Scope block.

You can access most signals inside the model hierarchy, including referenced models and Stateflow® charts. You cannot access optimized signals.

Scope viewers are attached to signal lines.
Data loggingSave data to a MATLAB® variable as an array, structure, or object.Save data to a MATLAB variable as an object.
Simulation controlRun, forward, and back toolbar buttons.Run, forward, and back toolbar buttons.Run, forward, and back toolbar buttons.
Scale axes after simulation

Toolbar buttons to Scale X-axis and Y-axis limits

Axes scaling set to Auto for the X-axis and Y-axis.

Toolbar button to scale only the Y-axis limits, and

Axes scaling set to Auto for only the Y-axis.

Toolbar buttons to Scale X-axis and Y-axis limits

Axes scaling set to Auto for the X-axis and Y-axis.

Add to modelAdd block from Simulink sinks library.Add block from Simulink sinks library.Add using Signal & Scope Manager. See Signal and Scope Manager.
Visual indication in model Floating Scope block not attached to any signal lines.Viewer icons located above signal lines for all attached signals.
Manage scopes centrallyNo.No.Use the Signal & Scope Manager to add or delete viewers, and attach or remove signals.
Manage scopes locallyAttach signal lines to Scope block in ports.Attach signals from the Floating Scope window.Add viewers and attach additional signals within a model hierarchy using the context menus.
Simulink Report Generator™ supportYes.Yes.No.
Connecting Constant block with Sample time set to inf (constant sample time) Plots all data values.Plots the data value at the first time step and anytime you tune a parameter.

Simulink Scope Versus DSP System Toolbox Time Scope

If you have Simulink and a DSP System Toolbox™ license, you can use either the Simulink Scope or DSP System Toolbox Time Scope. Choose the scope based on your application requirements, how the blocks work, and the default values of each block.

If you have a DSP System Toolbox license and you have been using Time Scopes, continue to do so in your applications. Using the Time Scope block requires a DSP System Toolbox license.

FeatureScopeTime Scope
Location in block librarySimulink Sinks libraryDSP System Toolbox Sinks library
Trigger and measurement panels

With Simulink only:

  • Trigger

  • Cursor Measurement

With DSP System Toolbox or Simscape™ license:

  • Signal Statistics

  • Bilevel Measurements

  • Peak Finder

  • Trigger

  • Cursor Measurements

  • Signal Statistics

  • Bilevel Measurements

  • Peak Finder

Simulation mode support for block-based sample times

For block-based sample times, all the inputs of the block run at the same rate.

  • Normal

  • Accelerator

  • Rapid-Accelerator

  • External

  • Rapid-Accelerator

  • External

Simulation mode support for port-based sample times

For port-based sample times, the input ports can run at different rates.

No.
  • Normal

  • Accelerator

Frame processing of signalsIncluded in Scope block with DSP System Toolbox license.Included in Time Scope block.
Sample time propagationIf the different ports have different sample rates, the scope uses the greatest common divisor of the rates.When using port-based sample times, the different ports of the Scope block inherit the different rates and plots the signals according to those rates.
Save model to previous Simulink releaseIf saving to a release before R2015a, the Scope block is converted to a scope with the features available in that release.No change in features.

This table lists the differences in Configuration Property default values between the Scope and Time Scope blocks.

PropertyScopeTime Scope
Open at start of simulationClearedSelected
Input processingElements as channels (sample based)Columns as channels (frame based)
Maximize AxesOffAuto
Time UnitsNoneMetric (based on Time Span)
Time-axis labelsBottom displays onlyAll
Show time-axis labelClearedSelected
Plot TypeAutoLine
Title%<Signal Label>No title
Y labelNo labelAmplitude

See Also

| |

Related Topics

Was this topic helpful?