Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Using the Signal and Scope Manager

Introduction

This section shows you how to use the Signal and Scope Manager to perform some basic Viewer and Generator object tasks.

If you are not familiar with the Signal and Scope manager, or Viewer or Generator objects, or if you do not know how to display the Signal and Scope manager, see Introducing the Signal and Scope Manager.

To learn how to use and adjust the viewers you have created, see The Scope Viewer Toolbar.

Attaching a New Viewer or Generator

To connect a new viewer or generator to a signal in the currently selected model:

  1. Display the Signal and Scope manager.

  2. Select a viewer or generator from the Types pane.

  3. Click Attach to Model.

  4. Click the Signal Selector button to display the Signal Selector dialog.

    For more information, see The Signal Selector.

  5. Select the signals to be displayed by this viewer, and close the dialog.

Creating a Multiple Axes Viewer

To create a viewer with more than one axes:

  1. Display the Signal and Scope manager.

  2. Select a viewer from the Types pane.

  3. Click Attach to Model.

  4. Click the #in pulldown, and select the total number of axes for the graph.

  5. Navigate to the Signals connected to Generator/Viewer pane and select Axes 1.

  6. Click the Signal Selector button to display the Signal Selector dialog.

    For more information, see The Signal Selector.

  7. Select the signals to add to this axis, and close the dialog.

  8. Select the next axes, and repeat steps 6 and 7. Continue in this way until signals have been added to all axes.

Adding Additional Signals to an Existing Viewer

To add signals to a viewer you have already created:

  1. Display the Signal and Scope manager.

  2. Navigate to the Viewers pane, and select the scope to which you will add signals.

  3. Click the Signal Selector button to display the Signal Selector dialog.

    For more information, see The Signal Selector.

  4. Select the signals to add to this viewer, and close the dialog.

Viewing Test Point Data

You can use the Signal and Scope Manager to view any signal that is defined as a test point in a submodel. A test point is a signal that is guaranteed to be observable when using a signal viewer in a model.

For more information, see Working with Test Points and Referencing a Model.

Adding Custom Viewers and Generators

You can add custom signal viewers or generators so that they appear in the Signal and Scope Manager. The following procedure assumes that you have a custom viewer named newviewer that you want to add.

  1. Open a new Simulink library.

    For example, open the Simulink browser and select File > New > Library.

  2. Save the library.

    For example, save it as newlib.

  3. In the MATLAB Command Window, set the library type.

    For example, use this command to set the library type of newviewer to viewer,

    set_param('newlib','LibraryType','SSMgrViewerLibrary')

    To set library type for generators, use the type 'SSMgrGenLibrary' as in this example:

    set_param('newlib','LibraryType','SSMgrGenLibrary')
  4. Set the display name of the library, as in this example:.

    set_param('newlib','SSMgrDisplayString','My Custom Library')
  5. Add the viewer or generator to the library.

  6. Set the iotype of the viewer, as in this example:

    set_param('newlib/newviewer','iotype','viewer')
  7. Save the library newlib.

    Select File > Save.

  8. Using the MATLAB editor, create a file named sl_customization.m. In this file, enter a directive to incorporate the new library as a viewer library.

    For example, to save newlib as a viewer library, add the following lines:

    function sl_customization(cm)
    cm.addSigScopeMgrViewerLibrary('newlib')
    %end function

    To add a library as a generator library, add a line like the following:

    cm.addSigScopeMgrGeneratorLibrary('newlib')
  9. Add a corresponding cm.addSigScope line for each viewer or generator library you want to add.

  10. Save the sl_customization.m file on your MATLAB path. Edit this file to add new viewer or generator libraries.

  11. To see the new custom libraries, restart MATLAB and start the Signal and Scope Manager.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS