Main Content

Simulink.fault.updateReferences

Synchronize model fault information files

Since R2023b

Description

Simulink.fault.updateReferences(model) synchronizes the fault information files used by the model, model. Synchronizing fault information files copies the faults and their properties from referenced models into the specified model. When you modify the faults in the top model, the changes do not affect the faults created in the referenced model.

example

Examples

collapse all

Open the faulted_counter model from the Example Referenced Model with a Fault example.

openExample('faultanalyzer/ReferencedModelWithFaultExample')
open_system("faulted_counter")

Add a fault to the Sum block output port.

Simulink.fault.addFault(...
"faulted_counter/Sum/Outport/1");

Save and close the faulted_counter model. Open the mdlref_basic_1 model that references the faulted_counter model.

save_system("faulted_counter");
close_system("faulted_counter");
open_system("mldref_basic_1");

Synchronize the fault information.

Simulink.fault.updateReferences("mldref_basic_1");

Open the instance of the referenced model from the parent model, ModelA.

open_system("mldref_basic_1/ModelA")
The fault you added appears as a copy from the reference model.

Input Arguments

collapse all

Path or handle to the model, specified as a string scalar, character vector, or model handle.

Data Types: string | char | double

Version History

Introduced in R2023b