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:
Scope and Floating Scope blocks — Scope, Floating Scope, Common Scope Block Tasks, Floating Scope and Scope Viewer Tasks.
Scope Viewer — Viewers and Generators Manager, Floating Scope and Scope Viewer Tasks.
Signal Logging — Save Simulation Data from Floating Scope.
Signal Test Point — Configure Signals as Test Points.
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.
Capability | Simulink Scope | Simulink Floating Scope | Simulink Scope Viewer |
---|---|---|---|
Attaching signals | Connect signal lines to a Scope block using input ports. | Attach signals interactively from the model before and during a simulation. See Add Signals to an Existing Floating Scope or Scope Viewer and Quickly Switch Visualization of Different Signals on a Floating Scope. | Attach signals from the Viewers and Generators Manager, interactively from the toolstrip, or using the signal line context menu. |
Access to signals | Because 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. You can access most signals inside the model hierarchy, including referenced models and Stateflow charts. You cannot access optimized signals. |
Data logging | Save data to a MATLAB® variable as an array, structure, or object. | Save data to a MATLAB variable as an object. | Save data to a MATLAB variable as an object. |
Simulation control | Run, 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
| Toolbar buttons to scale X-axis and Y-axis limits. Axes scaling set to
| Toolbar buttons to scale X-axis and Y-axis limits. Axes scaling set to
|
Add to model | Add block from Simulink sinks library. | Add block from Simulink sinks library. | Add using Viewers and Generators Manager. |
Visual indication in model | Scope block connected to signals. | Floating Scope block not attached to any signal lines. | Viewer icons located above signal lines for all attached signals. |
Manage scopes centrally | No. | No. | Use the Viewers and Generators Manager to add or delete viewers, and attach or remove signals. |
Manage scopes locally | Attach 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 or from the Scope viewer window. |
Simulink Report Generator™ support | Yes. | Yes. | No. |
Connecting Constant block with
Sample
time set to
inf (constant sample
time) | Plots the data value at the first time step and anytime you tune a parameter. | 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 a 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.
Feature | Scope | Time Scope |
---|---|---|
Location in block library | Simulink Sinks library | DSP System Toolbox Sinks library |
Trigger and measurement panels | With Simulink only:
With DSP System Toolbox or Simscape™ license:
|
|
Simulation mode support for block-based sample times For block-based sample times, all the inputs of the block run at the same rate. For rapid-accelerator mode, see Behavior of Scopes and Viewers with Rapid Accelerator Mode. |
|
|
Simulation mode support for port-based sample times For port-based sample times, the input ports can run at different rates. | No. |
|
Frame processing of signals | Included in Scope block with DSP System Toolbox license. | Included in Time Scope block. |
Sample time propagation | If 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 release | If 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.
Property | Scope Default | Time Scope Default |
---|---|---|
Open at start of simulation | Cleared | Selected |
Input processing | Elements as channels (sample based) | Columns as channels (frame based) |
Maximize Axes | Off | Auto |
Time Units | None | Metric (based on Time Span) |
Time-axis labels | Bottom displays only | All |
Show time-axis label | Cleared | Selected |
Plot Type | Auto | Line |
Title | %<Signal Label> | No title |
Y label | No label | Amplitude |
See Also
Floating Scope | Scope | Scope Viewer | Time Scope (DSP System Toolbox)
Related Topics
- Common Scope Block Tasks
- Display Time-Domain Data (DSP System Toolbox)
- Configure Time Scope Block (DSP System Toolbox)
- Floating Scope and Scope Viewer Tasks