Main Content

ChangeInformation

Detected changes in Safety Analysis Manager

Since R2024b

Description

ChangeInformation objects represent detected changes in Safety Analysis Manager spreadsheets. Use ChangeInformation objects to get information on the affected element in your spreadsheet and the changed artifact associated with the affected element. You must have Requirements Toolbox™ to use ChangeInformation objects.

Creation

To create a ChangeInformation object, use the getChanges function on a Safety Analysis Manager spreadsheet, spreadsheet row, or spreadsheet cell.

Properties

expand all

This property is read-only.

Affected element in the Safety Analysis Manager document, returned as a SpreadsheetRow or SpreadsheetCell object.

This property is read-only.

Type of change from the baseline, returned as one of these options:

Type ValueDescription
'linkCreated'The affected element in the Safety Analysis Manager document has a new link.
'linkChanged'The affected element in the Safety Analysis Manager document has a changed link.
'linkedArtifactChanged'The artifact that the affected element in the Safety Analysis Manager document links to has changed.
'linkOrLinkedArtifactRemoved'The affected element in the Safety Analysis Manager document has a deleted link, or the link links to a deleted artifact.

Data Types: char

This property is read-only.

Relation between the affected element and the changed artifact, returned as either an empty array or a slreq.Link object. The property is [] when the ChangedArtifact property is a slreq.Link object.

This property is read-only.

Changed artifact, returned as one of these options:

Relation ValueChangedArtifact Value
[]slreq.Link object
slreq.Link object

If the changed artifact is the link destination, the value of ChangedArtifact is a link destination structure that contains these fields:

  • domain

  • artifact

  • id

  • summary

  • reqSet

  • sid

If the changed artifact is the link source, the value of ChangedArtifact is a link source structure that contains these fields:

  • domain

  • artifact

  • id

For more information on link sources and destinations, see Create and Store Links (Requirements Toolbox). To retrieve the changed artifact as an object, use the slreq.structToObj (Requirements Toolbox) function on the value of this property.

Object Functions

acceptAccept detected change in Safety Analysis Manager document
navigateNavigate to changed artifact from detected change in Safety Analysis Manager document

Examples

collapse all

This example shows how to get detected changes in Safety Analysis Manager spreadsheets. You make a change to the fault linked to two cells in the spreadsheet, then detect and return the change information in the linked cells. The model represents a fuel control system for a gasoline engine, and is a modified version of the model in Evaluate Fault Combinations on a Fault-Tolerant Fuel System.

Open the sldemo_fuelsys_fault_analyzer model and the FuelSysFMEA.mldatx spreadsheet. Create the faults and the links between the faults and the spreadsheet by using the fuelSysFaultSetupProject function.

mdl = "sldemo_fuelsys_fault_analyzer";
open_system(mdl);
FMEAName = safetyAnalysisMgr.openDocument("FuelSysFMEA.mldatx");
fuelSysFaultSetupProject

Get the fault on the third input port of the To Controller subsystem by using the Simulink.fault.findFaults function.

myFault = Simulink.fault.findFaults(...
mdl,ModelElement=mdl + "/To Controller/Inport/3");

Set the trigger time of the fault to 10 by changing the Fault object property values. Save the fault information by using the Simulink.fault.save function.

myFault.StartTime = 10;
Simulink.fault.save(mdl)

Detect the changes to the linked fault in the FuelSysFMEA.mldatx spreadsheet by using the detectChanges function.

detectChanges(FMEAName)

Each artifact that links to the fault detects the change. Get the detected changes from each linked artifact as an array of ChangeInformation objects.

myChanges = getChanges(FMEAName);

Version History

Introduced in R2024b