Main Content

Copying Faults

Since R2025a

You can copy faults that you define in a model or library. You copy faults by copying the blocks that contain faults.

Copy Faults in Same Model

To copy a fault in the same model:

  1. Cut or copy the block.

    • Cut the block — Right-click the block and select Cut or click the block and press Ctrl+X.

    • Copy the block — Right-click the model element and select Copy or click the block and press Ctrl+C.

  2. Paste the block. Right-click the Simulink® model canvas and select Paste or click the model canvas and press Ctrl+V.

Pasting the block duplicates the block, the faults assigned to the block ports, and the fault behavior.

When you copy a fault into the same model, Simscape also adds the fault behavior to the fault model assigned to the original fault.

Copy Faults to Different Models

To copy a fault into a different model, use the steps described previously.

The fault information of each model tracks the model fault metadata independently. If the faults in each model use only one fault model, or if one of the models does not have faults, Simscape copies the fault behavior in the existing fault model. If the faults in each model use more than one fault model, Simscape asks you to select the fault model before copying the fault.

Copy Faults into Referenced Models

You can also copy faults into referenced models. When you copy a block into an instance of a referenced model:

  • The original referenced model updates automatically to include the copied block and faults.

  • Simscape duplicates the copied block across other instances of the referenced model, but does not automatically copy the faults. To copy the faults to the other referenced model instances, resynchronize the fault information files. In the Simscape Block tab, in the Faults section, click Resync Faults.

To add a fault to a single instance of a referenced model, access the referenced model from the top model, then define the faults.

Copy Faults from Model Libraries

You can add faults to libraries, and copy the library blocks into your models. Like standard Simscape models, libraries use a unique fault information file. To add a library block that has faults to a model, copy and paste the block or drag and drop it into the model. The Fault Table pane in your model includes the copied faults.

After you copy the library element into your model, the new fault is independent from the library and the model fault information file stores the copied fault data. If you change the fault in the library, the faults in your model do not change.

See Also

|