Main Content

Requirements Link Storage

The Requirements Management Interface (RMI) stores the requirements links associated with your Simulink® models in two modes - internal and external. When you create links from a model to requirements, by default, the Requirements Management Interface (RMI) stores the link information in an external .slmx file in the same folder as the model. External storage does not modify your model when creating or modifying requirements links.

To specify the requirements link storage setting:

  1. Open the Requirements Settings. In the Apps tab, click Requirements Viewer. In the Requirements Viewer tab, click Link Settings.

  2. In the Requirements Settings dialog box, select the Storage tab.

  3. Under Default storage location for traceability data:

    • To enable internal storage, select Store internally (embedded in Simulink diagram file).

    • To enable external storage, select Store externally (in a separate *.slmx file).

This setting applies immediately, and applies to new models and existing models that do not contain requirements links.

If you open a model that already has requirements links, the RMI uses the storage mechanism you used previously with that model, regardless of what your default storage setting is.

When links are stored with the model (internal storage), the time stamp and version number of the model changes every time you modify your requirements links.

Save Requirements Links in External Storage

The Requirements Management Interface (RMI) stores externally stored requirements links in a file whose name is based on the model file. Because of this, before you create requirements links to be stored in an external file, you must save the model with a value file name.

You add, modify, and, delete requirements links in external storage the same way you do when the requirements links are stored in the model file. The main difference is when you change externally stored links, the model file does not change. The asterisk in the title bar of the model window that indicates a model has unsaved changes does not appear when you change requirements links. However, when you close the model, the RMI asks if you want to save the requirements links modifications.

There are several ways to save requirements links that are stored in an external file, as listed in the following table.

Select...To...

In the Apps tab, click Requirements Manager. In the Requirements tab, click Save All.

Save the requirements links in an external file using a file name that you specify. The model itself is not saved.

In the Apps tab, click Requirements Manager. In the Requirements tab, click Save Links Only.

Save the requirements links in an external file using the default file name, model_name.slmx, or to the previously specified file. The model itself is not saved.

In the Simulation tab, click Save.

Save the current requirements links to an external file named model_name.slmx, or to the previously specified file. Model changes are also saved.
In the Simulation tab, Save > Save AsRename and save the model and the external requirements links. The external file is saved as new_model_name.slmx.

Load Requirements Links from External Storage

RMI attempts to load internally stored model requirements links from an .slmx file — either the default file or a previously specified file. If no .slmx file is found, RMI does not display requirements links.

Your links may be stored in an external file. To load links:

  1. In the Apps tab, click Requirements Viewer.

  2. In the Requirements Viewer tab, click Load Links.

  3. Select the file from which to load the requirements links.

  4. Click Open to load the links from the selected file.

Save changes to your links before loading links from another file.

Move Internally Stored Requirements Links to External Storage

If you have a model with requirements links that are stored with the model, you can move those links to an external file. When you move internally stored links to a file, the RMI deleted the internally stored links from the model file and saves the model. From this point on, the data exists only in the external file.

  1. Open the model that contains internally stored requirements links.

  2. In the Apps tab, click Requirements Manager. In the Requirements tab, click Save All.

    The Select a file to store RMI data dialog box prompts you to save the file with the default name model_name.slmx.

  3. Accept the default name, or enter a different file name if required.

  4. Click Save.

    Note

    Use the default name for externally stored requirements. For more information about this recommendation, see Guidelines for External Storage of Requirements Links.

Move Externally Stored Requirements Links to the Model File

If you have a model with requirements links that are stored in an external file, you can move those links to the model file.

  1. Open the model that has only externally stored requirements links.

  2. Make sure the right set of requirements links are loaded from the external file.

  3. In the Requirements tab, select Link Settings > Save Links in Model File.

    An asterisk appears next to the model name in the title bar of the model window indicating that your model now has unsaved changes.

  4. Save the model with the requirements links.

From this point on, the RMI stores requirements links internally, in the model file. When you add, modify, or delete links, the changes are stored with the model, even if the Default storage location for requirements links data option is set to Store externally (in a separate *.slmx file).

External Storage

The first time you create links to requirements in a Simulink model, the RMI uses your designated storage preference. When you reopen the model, the RMI loads the internally stored links, or the links from the external file, as long as the file exists with the same name and location as when you last saved the links.

The RMI allows you to save your links file as a different name or in a different folder. However, when you start with the links file in a nondefault location, you must manually load those links into the model. After you load those links, the RMI associates that model with that file and loads the links automatically.

As you work with your model, the RMI stores links using the same storage as the existing links. For example, if you open a model that has internally stored requirements links, new links are also stored internally. This is true even if your preference is set to external storage.

Requirements links must be stored either with the model or in an external file. You cannot mix internal and external storage within a given model.

To see an example of the external storage capability using a Simulink model, at the command line, enter:

slvnvdemo_powerwindow_external

Guidelines for External Storage of Requirements Links

Follow these guidelines when storing requirements links in an external file.

  • When sharing models, use the default name and location.

    By default, external requirements are stored in a file named model_name.slmx in the same folder as the model. If you give your model to others to review the requirements traceability, give the reviewer both the model and .slmx files. That way, when you load the model, the RMI automatically loads the links file.

  • Do not rename the model outside of Simulink.

    If you need to re-save the model with a new name or in a different location, in the Simulation tab, click Save. Selecting this option causes the RMI to re-save the corresponding .slmx file using the model name and in the same location as the model.

  • Be aware of unsaved requirements changes.

    If you create new requirements links that are stored externally, your model does not indicate that it has unsaved changes, because the model file itself has not changed. You can explicitly save the links, or, when you close the model, the RMI prompts you to save the requirements links. When you save the model, the RMI saves the links in the external file.

Copying Model Objects and their Linked Requirements

When you copy Simulink and Stateflow® objects, their associated requirements links are duplicated by default. Alternatively, you can choose to duplicate requirements links only when the links are highlighted in the Simulink model by following this process:

  1. In the Apps tab, open Requirements Manager.

  2. In the Requirements tab, ensure Layout > Requirements Browser is selected.

  3. In the Requirements pane, in the View drop-down menu, select Links.

  4. In the Requirements tab, click Link Settings > Default Link Storage.

  5. Select Duplicate links only when model requirements are highlighted.

Alternatively, you can navigate to Apps and open Requirements Viewer, then click Link Settings to view the same setting.

If you select Duplicate links only when model requirements are highlighted, your links will be duplicated when you copy model objects and, in the Requirements or Requirements Viewer tab, the Highlight links button is selected. If you don't want to duplicate links when copying model objects, ensure that Highlight links is not selected.

To change this setting programmatically, see rmipref and its preference 'DuplicateOnCopy'.