This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Inspect and Measure Transitions Using the Logic Analyzer

In this tutorial, you explore key functionality of the Logic Analyzer, such as choosing and configuring signals to visualize, stepping through a simulation, and measuring transitions.

Open a Simulink Model

To follow along with this tutorial, open the Sigma-Delta A/D Conversion (fixed-point version) model (dspsdadc_fixpt).

Open the Logic Analyzer

From the Simulink® toolbar, click the Logic Analyzer button . If the button is not displayed, click the Simulation Data Inspector button arrow and select Logic Analyzer from the menu.

The Logic Analyzer opens with the selected signals shown in the channel display.

Configure Global Settings and Visual Layout

  1. Click Settings. Set the Height to 20 and the Spacing to 10, and then click OK.

  2. From the Logic Analyzer toolstrip, click Add Divider. A divider named Divider is added to the bottom of your channels. You can use dividers to separate signals.

  3. Double-click Divider and rename Divider as Analog Input Calculation. Drag the divider to the top of the channels pane.

  4. Add another divider and name it Error Calculation.

  5. From the Logic Analyzer toolstrip, click Add Group. A group named Group1 is added to the bottom of your channels. You can use groups to group signals in a collapsible tree structure. Double-click Group1 and rename it as Digital Approximation Calculation.

  6. You can visualize the same signal in multiple places. Right-click the Analog Input(Delayed) signal and select Copy. Paste this signal under the Error Calculation divider. Repeat the process for the CIC Digitized Approximation signal. Organize your dividers and signals as shown in the screen shot, and then collapse the Digital Approximation Calculation group.

Set Stepping Options

  1. From the Logic Analyzer toolstrip, click Stepping Options.

  2. Select the Enable stepping back option. Specify the Maximum number of saved back steps as 2 and the Interval between stored back steps as 100 steps. When you run the simulation, a snapshot of the model is taken every 100 steps. Only the last snapshot is saved.

  3. Set Move back/forward by to 100 steps.

  4. Select the Pause simulation when time reaches option. Specify the simulation to pause after 0.2 seconds of model time has elapsed, and then click OK.

Run Model

  1. To run the model, click Run on the Logic Analyzer toolstrip. The model runs for 0.2 seconds of model time and then pauses.

  2. Click to fit your data to the time range.

Configure Individual Wave Settings

  1. Select all waves under your Analog Input Calculation divider. Then on the Waves tab, select a new Wave Color for the selected waves.

  2. Under the Error Calculation divider, select the Analog Input(Delayed) and CIC Digitized Approximation waves. On the Waves tab, modify the Format to Digital. The selected waves are now displayed as digital transitions.

Inspect and Measure Transitions

  1. On the Logic Analyzer toolstrip, click and then drag-and-drop start and end points to zoom in time.

  2. For waves displayed as digital, you can use the Next Transition and Previous Transition buttons. To move the active cursor to the next transition, click Next Transition.

  3. Click Lock to lock the active cursor in place.

  4. Click Add Cursor to add another cursor to the axes. The cursor shows its current position in time, and the difference from all surrounding cursors in time.

  5. Right-click the second cursor you added and select Delete Cursor.

  6. Press the space bar to zoom out.

  7. Add another cursor and line it up with a low point of the Analog Input wave in your Analog Input Calculation division. Use the value displayed in the wave value pane to fine-tune the cursor position in time.

  8. Add another cursor and line it up with the corresponding low point of the Analog Input(Delayed) wave in your Analog Input Calculation division.

Step Through Simulation

  1. To move the simulation forward 100 steps, click Step Forward. The time axis adjusts so that you can see the most recent data.

  2. To move the simulation backward 100 steps, click Step Back. The Step Back button becomes disabled because you specified saving only two back step.

Save Logic Analyzer Settings

When you save your model, the logic analyzer settings are also saved for that model.

See Also

|