Documentation Center

  • Trials
  • Product Updates

rmidata.save

Save requirements traceability data in external .req file

Syntax

Description

example

rmidata.save(model) saves requirements traceability data for a model in an external .req file. The model must be configured to store requirements traceability data externally. This function is equivalent to Analysis > Requirements > Save Links in the Simulink® Editor.

Examples

expand all

Create New Requirement Link and Save Externally

Add a requirement link to an existing example model, and save the model requirements traceability data in an external file.

Open the example model, slvnvdemo_powerwindowController.

open_system('slvnvdemo_powerwindowController');

Specify that the model store requirements data externally.

rmidata.default('external');

Create a new requirements link structure.

newReqLink = rmi('createEmpty');
newReqLink.description = 'newReqLink';

Specify the requirements document that you want to link to from the model. In this case, an example requirements document is provided.

newReqLink.doc = [matlabroot '\toolbox\slvnv\rmidemos\' ...
		'powerwin_reqs\PowerWindowSpecification.docx'];

Specify the text of the requirement within the document to which you want to link.

newReqLink.id = '?passenger input consists of a vector' ...
		'with three elements';

Specify that the new requirements link that you created be attached to the Mux4 block of the slvnvdemo_powerwindowController example model.

rmi('set', 'slvnvdemo_powerwindowController/Mux4', newReqLink);

Save the new requirement link that you just created in an external .req file associated with the model.

rmidata.save('slvnvdemo_powerwindowController');

This function is equivalent to the Simulink Editor option Analysis > Requirements > Save Links.

To highlight the Mux4 block, turn on requirements highlighting for the slvnvdemo_powerwindowController example model.

rmi('highlightModel', 'slvnvdemo_powerwindowController');

You can test your requirements link by right-clicking the Mux4 block. In the context menu, select Requirements > 1. "newReqLink".

Close the example model.

close_system('slvnvdemo_powerwindowController', 0);

You are not prompted to save unsaved changes because you saved the requirements link data outside the model file. The model file remains unchanged.

Input Arguments

expand all

model — Name or handle of model with requirements linksstring | handle

Name of model with requirements links, specified as a string, or handle to model with requirements links. The model must be loaded into memory and configured to store requirements traceability data externally.

If you have a new model with no existing requirements links, configure it for external storage as described in Specify Storage for Requirements Links. You can also use the rmidata.default command to specify storage settings.

If you have an existing model with internally stored requirements traceability data, convert that data to external storage as described in Move Internally Stored Requirements Links to External Storage. You can also use the rmidata.export command to convert existing requirements traceability data to external storage.

Example: 'slvnvdemo_powerwindowController'

Example: get_param(gcs,'Handle')

See Also

| |

Was this topic helpful?