Scope Module

This article presents the key functions available in Cockpit’s Scope module and provides some usage examples. For users seeking general assistance with Cockpit, getting-started documentation is available in PN300.

Scope module basics

The Scope module lets users display control variables on an oscilloscope-like interface by capturing and plotting every sample of the scoped user variables. The acquisition is performed at the control task rate (i.e., the controller’s main interrupt frequency), ensuring that every sample is scoped.

When used with the B-Box 4, the Scope also supports displaying raw data coming straight from I/O peripherals, which is acquired at a significantly faster rate. Specifically, analog inputs can be observed at a 10/20 Msps refresh rate, while digital signals are captured at 250 Msps. Overall, the scope can display:

  • Up to 32 user variables (CPU) for 40 seconds, or longer if fewer signals are used.
  • Over 400ms with 24 ADC channels active, or longer with fewer signals.
  • Up to 2 seconds when scoping all PWM channels, or longer with fewer signals.

To start the acquisition, drag and drop a variable from the project pane directly to a plot of the scope module.

Scope module interface

Screenshot of the imperix Cockpit Scope module interface. The upper section features an oscilloscope-like display with a plot preview (1) and main plot areas (2) showing three-phase sinusoidal signals (Vg_a, Vg_b, Vg_c) and a sawtooth waveform (theta). The interface is annotated with numbers 1 through 21, highlighting key features such as the trigger position (3), y-axis limits (4), and a toolbar containing view controls and an active green "ACQUIRING" state button (17). The bottom bar (21) displays a detailed table of the scoped user variables, including their display styles, scale, offset, units, and calculated metrics like minimum, maximum, and average values.
Scope module interface

The plot preview shows an overview of all the scoped signals. It can be collapsed to optimize space.

This is where the scoped signals are displayed. User variables can be dragged and dropped from the project pane. If multiple plots are created, their x-axis always remain synchronized.

The trigger level and position are shown with dedicated cursors. These can be adjusted by sliding the cursors. Alternatively, configuration is available in the Trigger configuration menu.

When hovering over the y-axis of each plot, the current limits of the y-axis range appear. Entering a new value in the fields adjusts the upper and lower limits accordingly.

When hovering over the y-axis of each plot, a lock icon shows up, which can be used to prevent unwanted zooming or auto-scaling.

Starts or stops the acquisition. At least one variable must be added to a plot for the acquisition to start.

Force the acquisition of one window, bypassing the trigger mechanism. This is useful when the trigger is configured in Normal or Single mode.

Performs an autoscale on both axes.

Perform an autoscale on the horizontal axis while keeping the vertical axis unchanged.

Perform an autoscale on the vertical axis of each plot while keeping the horizontal axis unchanged.

When switched on, vertical autoscaling is applied to each new acquisition window.

When switched on, a pair of slideable vertical cursors is shown. The signal metrics are then calculated within the corresponding interval. When the cursors are disabled, the same metrics are calculated over the entire acquisition window instead. Oversampled data is preferred over CPU data for computing the signal statistics.

The Formula builder allows creating a new scope variable from a mathematical formula that combines any displayed variables. Oversampled data, including digital signals, is also supported.

Opens the FFT/THD module, where the user can examine the acquired signals in the frequency domain.

Toggles displaying ADC channel data on all oversampled probe variables currently acquired in the Scope. Oversampled probes are explained in the Oversampled signals section.

Saves the current curves in a snapshot for future comparison. This mechanism is a global function operating throughout Cockpit, as explained in the User Guide.

Displays the current acquisition state. The possible acquisition states are:

  • Stopped: the acquisition is stopped. Data from the last acquisition is displayed.
  • Waiting: the acquisition has started and is awaiting a trigger event.
  • Acquiring: the trigger event has occurred, and the data are being captured. 
  • Offline: the target is disconnected from the host computer, or the user code is not running on the target.

The loading bar displays the acquisition and transmission status of the acquired window. Note that it is normal to see the loading bar partially filled while the acquisition is in Waiting state.

Starting from Cockpit version 2026.1, the height of plot areas in all modules can be resized by dragging the border between them. This button resets all plots in the Scope to an equal height.

Creates an empty plot area at the bottom of the scope module.

The scoped variables are listed in the bottom bar. There, the Scope tab allows users to:

  • Modify each variable’s display style, scale multiplier, offset value, and measurement unit
  • Remove a variable from scope
  • Toggle a variable’s visibility without removing it
  • Move variables between scope plot areas

Trigger configuration

The trigger mechanism of the Scope module behaves the same way as the trigger on a regular oscilloscope. The Trigger pane, located in the right bar, allows the configuration of the scope trigger.

Screenshot of the Scope module Trigger configuration pane in imperix Cockpit software. The panel displays several trigger settings with numbered annotations from 1 to 6, which correspond to the features detailed in the article. These point to the Window [ms] input field (1), the Edge dropdown set to Rising (2), the Signal dropdown set to Vg_a [Plot 0] (3), the Mode dropdown set to Auto (4), the Position [ms] and Level numerical input fields (5), and an enabled Ripple reject checkbox (6).
Trigger configuration pane

Sets the duration of the acquisition window, which affects the number of points acquired and the corresponding amount of data.

Defines whether to trigger on the rising edge, the falling edge, or both edges of the chosen signal.

Selects which signal is used for triggering the Scope. Once selected, this signal is marked with a (T) in the plot legend. Only variables currently added to the Scope are present in this drop-down list.

Screenshot of the imperix Cockpit Scope module Trigger configuration pane. The image highlights the expanded "Signal" dropdown menu, which displays various available trigger sources. The listed options include system events such as "PROTECTION TRIP" and "PWM ENABLED," user variables like "Iout_meas [Plot 0]" (which is currently highlighted/selected) and "Vin_meas [Plot 2]," as well as oversampled hardware channel signals including GPI, GPO, and PWM channels.

On the B-Box 4, the acquisition can also be triggered by ADC data, digital I/O channels, protection trips, or the PWM enable/disable state information. Whenever both CPU and oversampled data are available for a given measurement, the oversampled data is preferred.

Defines the trigger acquisition mode.
In Normal mode, acquisition is triggered when the signal reaches the trigger level. 
In Auto mode (default), the trigger behaves as in normal mode. However, acquisition is also triggered automatically every 100 ms if no trigger event occurs in the meantime.
In Single mode, a single window is acquired when the signal reaches the defined level. After that, the acquisition is stopped.

Defines the signal level that triggers the acquisition. This can also be adjusted by manually sliding the corresponding cursor inside the plot area.

When enabled, this feature improves the stability of oversampled ADC signals by preventing undesirable triggers on ripple. See the Ripple reject section below for more details. This option is only available on the B-Box 4 with SDK 2026.2 or newer.

Oversampled signals

Oversampling refers to acquiring analog signals at a rate faster than the CPU control rate and displaying them in the Scope module. This feature is exclusive to the B-Box 4 controller. It enables the observation of analog signals across the full sensor bandwidth, supporting superior data analysis and facilitating troubleshooting.

The Scope supports two types of oversampled signals:

  • ADC signals at the native acquisition rate of 20 Msps (or 10 Msps channels 12-23 are used)
  • Digital I/O (PWM, GPI, GPO, FLT) signals with a resolution of 250 Msps (4ns).

Oversampled inputs can be selected from the left bar in Cockpit. To display them, drag and drop them into the Scope like any other variable. Oversampled data is also automatically displayed for user variables that are closely connected to an ADC block in the user code. Users can then toggle oversampled data on or off by right-clicking the corresponding signal.

Oversampled probes showing the difference between the data available in the CPU and the data acquired by the ADCs

Oversampled data is also supported within the FFT/THD module, enabling analysis above the Nyquist frequency defined by the control rate. This notably permits the evaluation of switching ripple.

FFT/THD module showing a current with its switching harmonics.

Ripple reject

Oversampled signals often contain inherent ripple and high-frequency noise. Triggering on such signals may hence be difficult, resulting in unstable, jittery plots that are difficult to read and analyze.

To avoid false triggering and stabilize the display, the Ripple Reject function adds a trigger condition that ignores minor signal fluctuations and high-frequency ripple. The Ripple Reject mode is enabled by default, but can be disabled if needed. It is only available on the B-Box 4 with SDK 2026.2 or newer.

Transient generator

The transient generator allows users to define and impose stimuli on user variables. Both steps and ramps can be applied to any writable variable, such as those linked to a Tunable parameter block. If desired, transients can be applied to multiple variables simultaneously.

The Transient generator is typically useful for evaluating the transient response to reference steps (tracking performance) or external influences (perturbation rejection). In the example shown below, three consecutive steps are applied to Ig_d_ref, so that the current control performance can be evaluated on Ig_a, Ig_b, and Ig_c.

Scope module showing the result of a transient sequence (on the left). Transient configuration pane (on the right)

Defines the variable to which the stimuli are applied. Here, the variable Ig_d_ref is used.

Defines a vector of positions at which the stimulus values are applied. Here, events are set at 50ms, 100ms, and 150ms.

Defines a vector of values applied to the transient variable. Here, the values [10, 5, 15] are applied at [50, 100, 150] ms. The initial value of Ig_d_ref, namely 2.5, is held until the first event at 50ms.

Determines whether the set values are held until the next event, producing Steps, or used to define linear ramps between event points, producing Linear ramps.

Allows defining multiple sequences across multiple variables. Here, only one variable is altered.

These two buttons allow adding or removing transient events.

Toggles the preview of the sequence inside the scope. The corresponding stimuli then shows up as an editable signal in the same plot area as the original acquired variable. Toggling the preview and editing it do not fire the transient or affect the scope acquisition in any way.

Clicking this button launches the transient sequence on all transient variables. Once the sequence is finished, the acquisition is always Stopped, and all variables return to the value set before the transient.

Defining transients graphically

Transients can also be configured graphically. Clicking the preview button or any configurable field switches to the preview mode, provided that a valid transient is defined and that the variable exists in the Scope.

During preview, transient points appear as large dots. Using the mouse, dots can be dragged to set the desired time and amplitude values. To add a new point, double-click near the editable transient signal. To remove an existing point, right-click the point and select the ‘Remove point’ option.

These actions are synchronized with the settings in the right bar. Editing the transient preview does not affect the actual variable until the ‘Fire transient’ button is pressed. To exit the transient preview mode without firing the transient, press the Transient preview button in the right bar again.

Transient preview from the previous example after selecting the Linear interpolation option and dragging one transient event point

Formula Builder

The Formula Builder allows users to create extra mathematical variables for visualization inside the Scope. Any currently displayed variable can be used for that, including analog and digital oversampled data. Mathematical operators and functions provided by the Formula Builder are applied element-wise.

Math variables are calculated by Cockpit once the data is available on the computer, whereas their equivalents in the user code must be computed on the controller. This saves hardware resources and can also be defined more conveniently without recompiling the code.

Layout of the Cockpit Formula Builder

To create a new Math Variable, a unique and valid name is required. It cannot be edited after creation.

Optionally, the variable unit can be set here or via the bottom bar (as with any other variable).

Selects where the new Math Variable should be plotted. The variable can also be moved afterward.

Controls the appearance of the list of previously created formulae.

Here, the formula is defined either by typing it or by clicking on the options in the menus below.

The list contains all of the formulae that were successfully created before.

The menu contains all the binary operators usable for building a math formula.

The list contains all the functions available when building a math formula. The functions are grouped into three categories:

  1. General math is a collection of elementary (abs, exp, log, sgn, sqrt) and rounding functions (ceil, floor, round, trunc)
  2. Trigonometry includes all of the typical trigonometric and hyperbolic functions, along with conversion functions between degrees, radians, and gradians
  3. Scalar-valued functions are grouped based on the fact that they all evaluate to one number.

The list contains all the variables currently displayed inside the Scope. The formula can use any of them.

As the math formula is being typed, any potential error is displayed here, serving as guidance for creating a math expression that can be properly interpreted.

Clicking Save variable saves the currently entered formula. Pressing the Enter key is also possible.

Clicking Cancel closes the Formula Builder window without saving any changes.

Interacting with graphs and plots

Managing plot variables

To add a variable to a plot, select it in the USER VARIABLE, ANALOG INPUTS, or DIGITAL I/O section in the project pane, and drag and drop it over the plot. Multiple variables can be selected simultaneously by holding the Shift or Ctrl key. Once added to the Scope, variables also appear in the bottom bar, from where they can be removed or have their visibility changed.

For each variable, most actions can be performed from context menus by right-clicking on a plotted signal.

Managing plot areas

New plot areas can be added by clicking the + button in the bottom-right corner of the module. The total module height can be freely distributed between the plots.

  • To zoom in and out along the horizontal axis, place the mouse cursor over the area of interest. Then, use the mouse wheel to zoom in or out at the cursor’s location.
  • To zoom in and out along the vertical axis, place the mouse cursor over the area of interest. Then press the Ctrl key and use the mouse wheel to zoom in or out around the location of the mouse cursor.
  • To zoom in on a specific area, click and drag to draw a blue rectangle over it.
  • To achieve a horizontal auto-scale, right-click and drag horizontally. A light grey horizontal strip will appear. Release the mouse button to perform the horizontal auto-scale.
  • To achieve a vertical auto-scale, right-click and drag vertically. A light grey vertical strip will appear. Release the mouse button to perform the vertical auto-scale.
  • To enter panning mode, press and hold the middle mouse button or Ctrl + Left mouse button, then move the mouse.
  • To prevent a plot from changing the displayed range of values, hover over the y-axis and click the lock icon that shows up. The same can be done from the y-axis pane menu in the right bar.

Scope application examples

The following examples illustrate some use cases of the Scope module:

  • Measuring the speed tracking performance of an electric motor drive controller.