Main Content

Requirements Link Storage

When you create a link from a Model-Based Design item to a requirement, Requirements Toolbox™ stores the link information in an external SLMX file with a name that combines the source artifact base name and the source artifact extension, separated by a tilde. For more information, see Link Storage.

When you create a link from a Simulink® model to a requirement, you can store the links internally to the model or as an external file. External storage does not modify your model when you create or modify requirements links.

To specify the requirements link storage setting:

  1. Open the Requirements Settings. In the Apps tab, click Requirements Manager. In the Requirements pane, in the View drop-down menu, select Links. Then, in the toolstrip, click Link Settings > Linking Options.

  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~mdl.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~mdl.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~mdl.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 Manager.

  2. In the Requirements pane, set the View drop-down to Links.

  3. In the Requirements tab, click Load Links.

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

  5. 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 deletes the internal links data 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, open Requirements Manager.

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

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

  5. In the Requirements tab, click Link Settings > Save Links As Link Set File.

  6. Choose a file name and click OK.

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 externally stored requirements links.

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

  3. In the Apps tab, open Requirements Manager.

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

  5. 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.

  6. 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 when you load this model next time.

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.

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 As. 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.