The table below indicates the kinds of data you can plot using various combinations of blocks and parameter values. To view or set the parameters, open the dialog box using the Parameters toolbar button in the plot window.
|Scalar signal vs. time||Signal Scope||X value from = |
|Scalar signal vs. time||Scope|
|Scalar signal values without regard to time||Signal Scope||X value from = |
|Two scalar signals (X-Y plot)||X-Y Signal Scope|
|Attribute vs. time||Attribute Scope||X value from = |
|Attribute values without regard to time||Attribute Scope||X value from = |
|Two attributes of same entity (X-Y plot)||X-Y Attribute Scope|
|Attribute vs. scalar signal||Get Attribute block to assign the attribute value to a signal; followed by X-Y Signal Scope|
|Scalar signal vs. attribute|
|Number of entity arrivals per time instant||Instantaneous Entity Counting Scope|
|Number of events per time instant||Instantaneous Event Counting Scope|
The following table compares the capabilities of two blocks for plotting an event-based signal against time.
|Capability||Signal Scope Block (SimEvents Sinks library)||Scope Block (Simulink® Sinks library)|
|Includes markers to show sample time hits||Yes||No|
|Creates stair plots||Yes (default plot)||Yes|
|Creates stem plots||Yes (alternative to stair plot)||No|
|Creates continuous plots||Yes (alternative to stair plot)||No|
|Plots nonscalar signals||No||Yes|
|Plots multiple signals per window||No||Yes|
|Supports event-based signals||Yes||Yes|
|Supports time-based signals||No||Yes|
|Supports data types other than ||No||Yes|
|Available as a viewer||No||Yes|
Markers in the Signal Scope plot are especially useful when your event-based signal:
Assumes zero-duration values
Assumes the same value in consecutive sample time hits at different times
The following plots of the same event-based signal illustrate the additional information that markers provide.
Signal Scope Plot with Markers
Scope Plot Without Markers
The following table indicates the number, kind, and meaning of the input ports on each scope block.
|Block||Input Ports||Port Description|
|Signal Scope||One signal input port||Signal representing the data to plot|
|Scope||One signal input port||Signal representing the data to plot|
|X-Y Signal Scope||Two signal input ports||Signals representing the data to plot|
|Attribute Scope||One entity input port||Entities containing the attribute value to plot|
|X-Y Attribute Scope||One entity input port||Entities containing the attribute values to plot|
|Instantaneous Entity Counting Scope||One entity input port||Entities whose arrivals the block counts|
|Instantaneous Event Counting Scope||One signal input port||Signal whose signal-based events or function calls the block counts|
The following figure shows some typical arrangements of scope blocks in a model. Notice that the blocks that have entity input ports can have optional entity output ports, and that signal lines can branch whereas entity connection lines cannot.
You can configure certain scope blocks in the SimEvents Sinks library to determine whether and how the block connects the points that it plots. The following table indicates the options. To view or change the parameter settings, open the dialog box using the Parameters toolbar button in the plot window.
|Connection Characteristics||Setting||Sample Plot|
|Stairstep across, then up or down. Also known as a zero-order hold.||Plot type = |
|Vertical line from horizontal axis to point. No connection with previous or next plotted point. Also known as a stem plot.||Plot type = |
|Line segment from point to point. Also known as a first-order hold.||Plot type = |
|No connection with other points or with axis. Also known as a scatter plot.||Style > Line > None in the plot window|
Note: If no initial output, data value, or arriving entity indicates a value to plot at T=0, the plot shows no point at T=0. In this case, the plot does not connect the first plotted point to the T=0 edge of the plot.
Using parameters on the Axes tab of the dialog box of scope blocks in the SimEvents Sinks library, you set the initial limits for the axes of the plot. Also, these parameters let you choose how the block responds when a point does not fit within the current axis limits:
If X value is beyond limit
If Y value is beyond limit
Choices for the parameters are in the table.
|Maintain one limit while doubling the size of the displayed interval (without changing the size of the containing plot window)|
|Maintain both limits, which means that points outside the limits do not appear|
|Maintain the size of the displayed interval while changing both limits|
Other operations can still affect axis limits, such as the autoscale, zoom, and pan features.
To store the current limits of both axes for the next simulation, select Axes > Save axes limits from the plot window menu.
The Data History tab of the dialog box of scope blocks in the SimEvents Sinks library lets you balance data visibility with simulation efficiency. Parameters on the Data History tab determine how much data the blocks cache during the simulation. Caching data lets you view it later, even if the scope is not open during the simulation. Caching less or no data accelerates the simulation and uses less memory.
If you set the Store data when scope is closed parameter
Limited, uncached data points disappear
The simulation ends
You interact with the plot after pausing the simulation (using Simulation > Pause, for example)
The following examples use scope blocks to create different kinds of plots:
|Plot the Queue-Length Signal and Observations from Plots||Stairstep and continuous plots of statistical signals|
|Round-Robin Approach to Choosing Inputs||Stem plot of data from an attribute|
|Preemption by High-Priority Entities||Unconnected plot of a signal using dots|
|Set Attributes||Stairstep plots of data from attributes using Attribute Scope blocks as sinks|
|Synchronize Service Start Times with the Clock||Stem plots that count entities using Instantaneous Entity Counting Scope blocks with entity output ports|
|X-Y Signal Scope reference page||Continuous plot of two signals|
|X-Y Attribute Scope reference page||Unconnected plot of two attributes using x's as plotting markers|