Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

dsp.LogicAnalyzer System object

Package: dsp

Visualize, measure, and analyze transitions and states over time

Description

The LogicAnalyzer System object™ displays the transitions in time-domain signals.

To display the transitions of signals in the Logic Analyzer:

  1. Define and set up your Logic Analyzer. See Construction.

  2. Call step to display the transitions of the signals in the Logic Analyzer figure.

Use the MATLAB® clear function to close the Logic Analyzer figure window and clear its associated data. Use the hide method to hide the Logic Analyzer window and the show method to make it visible.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Construction

scope = dsp.LogicAnalyzer creates a Logic Analyzer System object, scope.

scope = dsp.LogicAnalyzer(Name,Value) sets each property Name to the specified Value. Unspecified properties have default values.

Properties

expand all

If a property is listed as tunable, then you can change its value even when the object is locked.

Background color of the display, specified as 'Black' or 'White'.

Tunable: Yes

Data Types: char

Color for channels in the display, specified as an RGB triplet.

An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7].

Tunable: Yes

Data Types: double | single | uint8 | uint16 | uint32 | uint64 | int8 | int16 | int32 | int64

Font size for channels in the display, in points, specified as a nonnegative scalar integer.

Tunable: Yes

Data Types: double | single | uint8 | uint16 | uint32 | uint64 | int8 | int16 | int32 | int64

Format for channels in the display, specified as one of the following:

  • 'Automatic' — Displays floating-point signals in Analog format and integer and fixed-point signals in Digital format. Boolean signals are displayed as zero or one.

  • 'Analog' — Shows values as an analog plot.

  • 'Digital' — Shows values as digital transitions.

Tunable: Yes

Data Types: char

Channel height in the display, in pixels, specified as a positive real scalar in the range 8 to 200.

Tunable: Yes

Data Types: double | single | uint8 | uint16 | uint32 | uint64 | int8 | int16 | int32 | int64

Base of the enumeration used to display values, specified as one of the following:

  • 'Hexadecimal' — Displays values as symbols from zero to nine and A to F

  • 'Binary' — Displays values as zeros and ones

  • 'Octal' — Displays values as numbers from zero to seven

  • 'Signed decimal' — Displays the signed, stored integer value

  • 'Unsigned decimal' — Displays the stored integer value

This property applies only to fixed-point (fi) values.

Tunable: Yes

Data Types: char

Spacing between channels in the display, in pixels, specified as a positive scalar integer.

Tunable: Yes

Data Types: double | single | uint8 | uint16 | uint32 | uint64 | int8 | int16 | int32 | int64

Caption to display on the scope window, specified as a character vector.

Tunable: Yes

Data Types: char

Number of input signals, specified as a positive scalar integer. You must call the step method with the same number of inputs as the value of this property.

Data Types: double | single | uint8 | uint16 | uint32 | uint64 | int8 | int16 | int32 | int64

Position of the scope window on your screen, in pixels, specified as a [left bottom width height] vector. The default position depends on your screen resolution. By default, the scope window appears in the center of your screen, with a width of 800 pixels and height of 600 pixels.

Tunable: Yes

Data Types: double | single | uint8 | uint16 | uint32 | uint64 | int8 | int16 | int32 | int64

Sample time of inputs in seconds, specified as a finite numeric scalar. The same sample time is used for all inputs.

Data Types: double | single | uint8 | uint16 | uint32 | uint64 | int8 | int16 | int32 | int64

Time display offset in seconds, specified as a nonnegative scalar.

Tunable: Yes

Data Types: double | single | uint8 | uint16 | uint32 | uint64 | int8 | int16 | int32 | int64

Time span in seconds, specified as a positive scalar. The x-axis limits are calculated as follows:

  • Minimum x-axis limit = min(TimeDisplayOffset)

  • Maximum x-axis limit = max(TimeDisplayOffset) + TimeSpan

TimeDisplayOffset and TimeSpan are the values of their respective properties.

Tunable: Yes

Data Types: double | single | uint8 | uint16 | uint32 | uint64 | int8 | int16 | int32 | int64

Methods

addCursorAdd cursor to display
addDividerAdd divider to display
addWaveAdd wave corresponding to specified input
deleteCursorDelete specified cursor
deleteDisplayChannelDelete specified display channel
getCursorInfoReturn settings for specified cursor
getCursorTagsReturn all cursor tags
getDisplayChannelInfoReturn settings for specified display channel
getDisplayChannelTagsReturn all display channel tags
hideHide scope window
modifyCursorModify properties of specified cursor
modifyDisplayChannelModify properties of specified display channel
moveDisplayChannelMove position of specified display channel
resetReset internal states of scope object
showMake scope window visible
stepDisplay signal in scope figure

Examples

expand all

Create a dsp.LogicAnalyzer object. Call the scope in a loop to display the signals.

scope = dsp.LogicAnalyzer('NumInputPorts',3);
for ii = 1:20
    scope(ii,10*ii,20*ii);
end

Create a dsp.LogicAnalyzer object with four channels. Call modifyDisplayChannel to set the radix of each of the channels. Run the scope in a loop to display the waves.

scope = dsp.LogicAnalyzer('NumInputPorts',4,'DisplayChannelFormat','Digital');
scope.TimeSpan = 12;

modifyDisplayChannel(scope,1,'Name','Index','Radix','Unsigned decimal');
modifyDisplayChannel(scope,2,'Name','Fi_hex','Radix','Hexadecimal');
modifyDisplayChannel(scope,3,'Name','Fi_bin','Radix','Binary');
modifyDisplayChannel(scope,4,'Name','Fi_actual','Radix','Signed decimal');

for ii = 1:20
    fival = fi((ii-1)/16,0,4,4);
    scope(ii,fival,fival,fival);
end

Define a WeekDaysInt class to hold an enumerated list of weekday values. Create and save the following class definition file.

classdef WeekDaysInt < int32
  enumeration
    Monday(1), Tuesday(2), Wednesday(3), Thursday(4), Friday(5)
  end
end

Create and configure the vector, complex, and enumerated data signals.

s{1} = dsp.LogicAnalyzerWave('InputChannel',1,...
     'Name','Vector Digital');
s{2} = dsp.LogicAnalyzerWave('InputChannel',2,...
     'Name','Vector Analog', 'Format','Analog',...
     'Height',80);
s{3} = dsp.LogicAnalyzerWave('InputChannel',3,...
     'Name','Complex Digital');
s{4} = dsp.LogicAnalyzerWave('InputChannel',4,...
     'Name','Complex Analog', 'Format','Analog',...
     'Height',80,'Color','Green');
s{5} = dsp.LogicAnalyzerWave('InputChannel',5,...
     'Name','Enum Digital');
s{6} = dsp.LogicAnalyzerWave('InputChannel',6,...
     'Name','Enum Analog', 'Format','Analog',...
     'Height',80);

Create a dsp.LogicAnalyzer object. Call the object in a loop to display the signals.

scope = dsp.LogicAnalyzer('DisplayChannels',s,...
     'NumInputPorts',numel(s));

t = 30;
for c = 1:t
    sinValVec       = sin(c/t*2*pi);
    cosValVec       = cos(c/t*2*pi);
    cosValVecOffset = cos((c+10)/t*2*pi);
    sinValReal      = sin((c+2)/t*2*pi);
    cosValImag      = cos((c+2)/t*2*pi);

    % Create a weekday enumerated value by wrapping the index
    day = WeekDaysInt(1+mod(c-1,5));

    scope(...
          [c (c-(t/2))],...                         % digital vector
          [sinValVec cosValVec cosValVecOffset],... % analog vector
          complex((c-(t/2)),c),...                  % digital complex
          complex(sinValReal, cosValImag),...       % analog complex
          day,...                                   % digital enum
          day...                                    % analog enum
          )
end

Configure Visualization of Logic Analyzer

The Logic Analyzer Global Settings dialog box controls the default visual configuration of the Logic Analyzer display. From the Logic Analyzer toolstrip, select Settings to open this dialog box. Any settings made on individual signals supersede the global setting.

Set the display Radix of your signals as one of the following:

  • Hexadecimal — Displays values as symbols from zero to nine and A to F

  • Octal — Displays values as numbers from zero to seven

  • Binary — Displays values as zeros and ones

  • Signed decimal — Displays the signed, stored integer value

  • Unsigned decimal — Displays the stored integer value

Set the display Format as one of the following:

  • Automatic — Displays floating point signals in Analog format and integer and fixed-point signals in Digital format. Boolean signals are displayed as zero or one.

  • Analog — Displays values as an analog plot

  • Digital — Displays values as digital transitions

Set the display Time Units to one of the following:

  • Automatic — Uses a time scale appropriate to the time range shown in the current plot

  • seconds

  • milliseconds

  • microseconds

  • nanoseconds

  • picoseconds

  • femtoseconds

You can expand fixed-point and integer signals and view individual bits. The Display Least Significant bit first option enables you to reverse the order of the displayed bits.

Inspect the graphic for an explanation of the global settings: Wave Color, Axes Color, Height, Font Size, and Spacing. Font Size applies only to the text within the axes.

Introduced in R2013a

Was this topic helpful?