PLECS 3.3 Online Help

Using the PLECS Scope

The PLECS scope is used to display simulation results and offers powerful zooming and analysis tools to simplify viewing and processing results. The PLECS scope can be placed on the Simulink worksheet or in the PLECS circuit. The appearance of the PLECS scope is depicted below. The scope contains a plot area and optional Zoom view, Saved view and Data view windows.

[Picture]

Getting Started

To use the scope, drag the scope block from the PLECS library onto your worksheet or schematic diagram. The scope block for Simulink can be found in the top level of the PLECS library. The scope block for a PLECS circuit is located in the PLECS Sources & Meters library.

Double clicking on the Scope block opens the Scope window. The main window of the scope can contain multiple plots. Plots can be quickly added or removed by right clicking the plot area and selecting Insert plot above, Insert plot below or Remove plot from the context menu.

The optional Zoom view, Saved view and Data view windows can be opened by right-clicking on the toolbar area. They can also be opened from the View menu. These optional windows can be docked and undocked from the main window. To dock them in main window, simply drag them to the desired location inside the main window.

Zoom Operations

Zooming is performed by clicking on the plot area and dragging the mouse until the desired area is selected. Two zoom modes exist: Constrained Zoom and Free Zoom. The zoom mode is selected using the toolbar button. To temporarily switch zoom modes, the Ctrl key (cmd key with Mac OS) can be pressed.

Constrained Zoom   [Picture]

With Constrained Zoom, zooming is only performed in the x or y direction. The zoom direction is selected by moving the mouse horizontally or vertically.

Free Zoom   [Picture]

With Free Zoom mode activated, the zoom area is defined by dragging the zoom cursor over a certain portion of the plot.

Zoom to Fit   [Picture]

Zoom to fit will fit the entire waveform into the plot window.

Zoom to Specification

A zoom range can also be manually specified. Double-clicking on the x or y axis opens a window in which the x or y range of the zoom area can be entered.

Previous View, Next View   [Picture] [Picture]

Every time a zoom action is performed, the view is stored in the view history. The previous and next view buttons allow you to navigate backwards and forwards through the view history.

Panning

A zoom area can be panned by dragging the x or y axes of the plot with the hand symbol that appears.

Zoom Area Window

The zoom area window displays the entire waveform and highlights the zoom view that is displayed in the plot window. Constraint Zoom and Free Zoom can also be performed in the zoom area window. The zoom area window is activated by right clicking on the toolbar.

Changing Curve Properties

By default, the curves for the different signals and/or traces in a plot are drawn with a pen that is defined by the palette selected in the PLECS preferences (see Scope Colors).

To change individual curve properties (color, line style and width), right-click on a plot and select Edit curve properties from the context menu. This will open a table listing the properties of all visible curves. To change a particular property, double-click on the corresponding table cell.

Locally changed properties are highlighted with a white background and are stored persistently in the model file. In contrast, properties that are defined by the global scope palette have a grey background. To remove all local changes click on Restore Defaults.

Spreading Signals

When using a single plot to display multiple signals that assume only a small number of discrete values (such as gate signals), it can be difficult to properly see the value that a particular signal has. You can have the scope automatically separate the signals in a plot by offsetting and scaling them appropriately. All signals are scaled by the same factor and the offsets are distributed evenly in order to maintain the proportions between the signal. Vertical scrolling and zooming is disabled in this mode.

To enable signal spreading, right-click on a plot and select Spread signals from the context menu. While spreading is enabled, the y-axis will only display the zero-lines for the individual signals, and zooming in the y-direction is disabled.

Cursors   [Picture]

The cursors are used for measuring waveform values and analyzing the simulation results. Cursors can be positioned by dragging them to a specific time location, or by manually entering a value in the Time row in the Data Window.

When the cursors are moved, they will snap to the nearest simulation time step. To place the cursors arbitrarily, hold down the Shift key while moving the cursor. The values in the data window will be displayed in italics to indicate they are interpolated from the two nearest time steps.

Data Window

When the cursors are activated, the data window appears if it was not already open. By default, the data window displays two columns in which the time and data value of each signal at the position of each cursor are given. The signal names are also displayed and can be modified by double-clicking on the name.

A right-click into the Data Window shows a context menu. Selecting "Copy to Clipboard" copies the current contents of the table to the system clipboard. Afterwards the data can be pasted into other applications, e.g. a spreadsheet tool or word processor.

Signal Type

A small icon that represents the signal type is shown next to the signal name in the data view window. Signals can be of the continuous, discrete or impulse type. The scope automatically determines the signal type from the port settings of the connected signal to ensure the signal is displayed correctly. The signal type can be overridden if necessary by clicking on the signal type icon.

Analyzing Data

Right-clicking on the data view header line in the data view window allows for additional data analysis columns to be displayed. For example, difference, RMS, min, max, and total harmonic distortion (THD) analysis can be performed. The analysis is performed on the data between the two cursors. For meaningful RMS and THD values the cursor range must be equal to the period of the fundamental frequency.

Locking the Cursors

Locking the cursors can be useful for performing measurements over a fixed time period, such as the time period of an ac voltage. When dragging one of the locked cursors, the other cursor will be moved in parallel at a specified time difference. To lock the cursors, the Delta column in the Data Window must be made visible by right-clicking on the table header. The desired cursor distance can be entered in the Time row of the Delta column. The cursors can be unlocked by double-clicking on the lock icon in the Delta column.

Fourier Analysis   [Picture]

A Fourier analysis of the data in the current cursor range is accessible from the View menu. The use of the Fourier analysis is detailed in section Using the Fourier Analysis.

Saving a View   [Picture]

A particular zoom view can be saved by pressing the eye button. The saved views window will appear if it was not already displayed and the new view will be added to the saved views list. To access a particular saved view, click on the view name in the saved views window. Saved views can be renamed by double clicking the name of the view, and reordered by clicking and dragging an entry up and down in the list. A view can be removed with the red delete button.

Adding Traces   [Picture]

After a simulation has been completed the resulting curves can be saved as a trace. Traces allow to compare the results of different simulation runs.

A new trace is added by either pressing the Hold current trace button in the toolbar or by pressing the green plus button next to the Current Trace entry in the Traces window. To remove a trace press the red minus button next to the trace in the Traces window. Held traces can be reordered by clicking and dragging an entry up and down in the list.

Traces can also be added and removed by simulation scripts. For details, see section Holding and Clearing Traces in Scopes.

Saving and Loading Trace Data

Existing traces in a scope can be saved by selecting Save trace data... from the File menu. The saved traces can be loaded into a scope for later reference. The scope into which the trace data is loaded must have the same number of plots as the scope from which the data was saved. The number of input signals per plot should also mach, otherwise the trace data is lost when a new simulation is started.

Scope Parameters   [Picture]

The scope parameters dialog allows for the appearance of the scope to be changed and automatic or custom zoom settings to be applied to the x and y axes. More information can be found in the Scope Parameters Description. The plot background color can be changed in the PLECS preferences (see section Configuring PLECS).

Printing and Exporting

A plot can be printed or exported from the File menu. When printing, the appearance of the plot and legend can be changed using the Page Setup option. When exporting, the plot style can also be changed and the output size of the image can be customized.

The data table can be exported to e.g. Microsoft Excel using the clipboard. To copy the data to the clipboard open the context menu by right-clicking and choose "Copy to clipboard".