| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
| On this page… |
|---|
Attaching a New Viewer or Generator Creating a Multiple Axes Viewer |
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.
To connect a new viewer or generator to a signal in the currently selected model:
Display the Signal and Scope manager.
Select a viewer or generator from the Types pane.
Click Attach to Model.
Click the Signal Selector button to display the Signal Selector dialog.
For more information, see The Signal Selector.
Select the signals to be displayed by this viewer, and close the dialog.
Tip To display a viewer that has been attached, double click on the viewer of interest in the Viewers pane. |
To create a viewer with more than one axes:

Display the Signal and Scope manager.
Select a viewer from the Types pane.
Click Attach to Model.
Click the #in pulldown, and select the total number of axes for the graph.
Navigate to the Signals connected to Generator/Viewer pane and select Axes 1.

Click the Signal Selector button to display the Signal Selector dialog.
For more information, see The Signal Selector.
Select the signals to add to this axis, and close the dialog.
Select the next axes, and repeat steps 6 and 7. Continue in this way until signals have been added to all axes.
Tip
|
To add signals to a viewer you have already created:
Display the Signal and Scope manager.
Navigate to the Viewers pane, and select the scope to which you will add signals.
Click the Signal Selector button to display the Signal Selector dialog.
For more information, see The Signal Selector.
Select the signals to add to this viewer, and close the dialog.
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.
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.
Note If the viewer is a compound viewer, such as a subsystem with multiple blocks, make the top-level subsystem atomic. |
Open a new Simulink library.
For example, open the Simulink browser and select File > New > Library.
Save the library.
For example, save it as newlib.
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')Set the display name of the library, as in this example:.
set_param('newlib','SSMgrDisplayString','My Custom Library')Add the viewer or generator to the library.
Set the iotype of the viewer, as in this example:
set_param('newlib/newviewer','iotype','viewer')Save the library newlib.
Select File > Save.
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 functionTo add a library as a generator library, add a line like the following:
cm.addSigScopeMgrGeneratorLibrary('newlib')Add a corresponding cm.addSigScope line for each viewer or generator library you want to add.
Save the sl_customization.m file on your MATLAB path. Edit this file to add new viewer or generator libraries.
To see the new custom libraries, restart MATLAB and start the Signal and Scope Manager.
![]() | Introducing the Signal and Scope Manager | The Signal Selector | ![]() |

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 |