If you’d like to follow along, you can download our example zip file. It contains all the example files used throughout the manual.
Simulink viewer
The simulink viewer has three panes.
- Model tree (Upper-left)
- Displays the entire model hierarchy.
- Element tree (Lower-left)
- Shows the properties for whatever element (block, wire, state, etc.) is currently selected. Some elements, such as the root model element, have a complex hierarchy of properties.
- Graphic view (Right)
- Graphically presents the currently open system, state chart, or script.
The same interface is used for Simulink and Stateflow, …
… as well as for embedded MATLAB scripts and model callbacks.
Toolbar legend
Action | Icon | Key | Description |
---|---|---|---|
File status | [Ctrl Shift S] | Opens the file status for this file. | |
Expand all | [Ctrl =] | Expands all collapsed elements in the model tree. | |
Collapse all | [Ctrl -] | Collapses all elements in the model tree. | |
Zoom in | [=] | Zooms in. | |
Zoom out | [-] | Zooms out. | |
Zoom 1:1 | [0] | Sets the zoom to 1:1. | |
Zoom fit | [-] | Sets the zoom so that the view contents fill (but but do not exceed) the size of the view. | |
Reload | [F5] | Reloads the folder. | |
Config | [F12] | Opens the config dialog. |
Config
The Simulink viewer does not have any properties in its config. The Simulink differ, however, has several (see below).
Simulink differ
The Simulink differ has four panes
- Model diff (Upper-left)
- Displays a diff of the model hierarchies.
- Element diff (Lower-left)
- Shows a diff of the properties for whichever pair of elements (blocks, wires, states, etc.) is currently selected. Some elements, such as the root model element, have a complex hierarchy of properties.
- Property diff (Lower-right)
- Shows a character-by-character diff of the currently selected property (the property which was clicked in the element diff).
- Graphic diff (Right)
- Graphically presents the diff of the currently open system, state chart, or script.
The colors in all of the views correspond to the following color scheme (the same scheme used in the folder differ).
- Green means the files are the same.
- Red means the files are different.
- Blue means the files exist on only one side (they were added).
- Grey is the color used for children of Blue folders. It indicates that these files are beyond the edge of the diff.
- Orange represents files which are the same at this level, but contain children with Blue or Red elements.
In the screenshot below, the “BurnerOff” state is selected. Looking at the element diff, we can see that some properties have an icon next to them. This means that these properties are ignored when determining whether an element should be colored red or green. Many properties (such as “subviewer”) are related to arbitrarily generated identifiers which can change without affecting the actual model behavior. By default, these arbitrary identifiers are ignored.
In the case of “BurnerOff”, the only unignored property which has changed is “position” - the state’s behavior has not changed. It’s good to know that the state has moved, but for now we don’t want to be distracted by aesthetic differences - we want to focus on substantive changes in the model’s behavior. If we right-click the “position” property, we will get the following pop-up.
If we add “position” to the list of ignored Stateflow properties, “BurnerOff” instantly turns green (in the screenshot below, it is green in the model diff but still magenta in the graphic diff because the current selection is always colored magenta in Stateflow). Now that we’re ignoring “position”, several other states have also turned green. This helps us to focus our attention on the more important differences - an “OvenNominal” and “OvenFailed” state were added, and the “calc_equilibrium” function was changed.
Embedded matlab scripts and model callback scripts are diffed using a special version of the text differ.
Toolbar legend
Action | Icon | Key | Description |
---|---|---|---|
Expand all | [Ctrl =] | Expands all elements up to the edge of the diff. | |
Expand all deep | [Ctrl Shift =] | Expands all elements, even those which were beyond the extent of the diff (grey elements). | |
Collapse all | [Ctrl -] | Collapses all elements. | |
Hide identical | [Ctrl H] | Hides all green elements. | |
First conflict | [Ctrl Shift ↑] | Navigates to the first conflict. | |
Previous conflict | [Ctrl ↑] | Navigates to the previous conflict. | |
Next conflict | [Ctrl ↓] | Navigates to the next conflict. | |
Last conflict | [Ctrl Shift ↓] | Navigates to the last conflict. | |
Toggle diff colors | [C] | Toggles whether the graphical diff is highlighted based on its diff status, or its actual colors. | |
Zoom in | [=] | Zooms in. | |
Zoom out | [-] | Zooms out. | |
Zoom 1:1 | [0] | Sets the zoom to 1:1. | |
Zoom fit | [-] | Sets the zoom so that the view contents fill (but but do not exceed) the size of the view. | |
Reload | [F5] | Reloads the folder. | |
Config | [F12] | Opens the config dialog. |
Config
On the left side of the config are the Simulink properties, and on the right side are the Stateflow properties.
The Ignored properties list is used for filtering the many different kinds of changes a model can undergo. DiffPlug will color an element green even if some of its properties have changed, so long as all of the changed properties are on the ignored list.
If Lines with same name and topology are always green is checked, it means that lines will not be colored red just because they were moved or rerouted. A line will only become red if it connects to a different block. The Transitions with same name and topology are always green option behaves in the same way.