getTriggeredFaults
Description
returns the faults that use the conditional fault
= getTriggeredFaults(conditional
)conditional
as the
trigger.
Examples
Retrieve Fault Triggered by Conditional
Open a model with a block that supports fault modeling.
openExample('simscape_shared/SimpleMotorArmatureWindingFaultExample')
Add a fault called myFault
to the Armature
winding
model subelement of the DC Motor
block.
myFault = Simulink.fault.addFault(... "SimpleMotorArmatureWindingFault/DC Motor/Armature winding",... Name="myFault");
Add an empty behavior to the fault.
addBehavior(myFault,"myBehaviorModel");
Define the TriggerType
property for the fault object.
myFault.TriggerType = "Conditional";
Add a conditional named myConditional
to the model, and specify
the condition expression as y1 >= 0
.
faultConditional = Simulink.fault.addConditional(... "SimpleMotorArmatureWindingFault","myConditional","y1 >= 0");
Define the Conditional
property of the fault
object.
myFault.Conditional = faultConditional;
Find the conditional in the model.
faultConditional = Simulink.fault.findConditionals(... "SimpleMotorArmatureWindingFault")
faultConditional = Conditional with properties: Name: 'SampleConditional' Condition: 'x == true' LogActivity: 0
Find the fault that uses the conditional.
myFault = getTriggeredFaults(faultConditional)
myFault = Fault with properties: Name: 'myFault' Description: '' ModelElement: 'SimpleMotorArmatureWindingFault/DC Motor/Armature winding' Type: 'Simscape' IsActive: 1 TriggerType: 'Conditional' Persistent: 1 Conditional: [1×1 Simulink.fault.Conditional]
Input Arguments
conditional
— Conditional assigned to faults
Conditional
object
Conditional assigned to the faults in a model, specified as a
Conditional
object.
Output Arguments
fault
— Faults in model
Fault
object array
Faults in the model that use the conditional as a trigger, returned as a
Fault
object array.
Version History
Introduced in R2023b
See Also
Objects
Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)