Stateflow: how to add a preemptive transition? (No depth first semantic)
6 次查看(过去 30 天)
显示 更早的评论
I want that if the flollowing transitions:
- From Normal to Fault
- From Unplugged to Plugged
are either true, the EFSM pass from Normal to Fault and not from Unplugged to Plugged.
I don't want a depth first semantic.
Can you help me? Thanks!
0 个评论
回答(1 个)
Aditya Saikumar
2024-8-5
Hi Roberto,
It is my understanding that you want the transition from “Normal” to “Fault” to have a higher priority than the transition from “Plugged” to “Unplugged”. By default, this is how Stateflow chart execution works. Please check out the following MATLAB documentation link which contains examples of how the execution works.
So, even if the active substate is “Unplugged”, the transition condition from superstate “Normal” to “Fault” is evaluated first and later the transition condition from “Unplugged” to “Plugged”.
In case you want a transition directly from “Unplugged” to “Fault”, you can achieve that by simply having that transaction with the required condition just like any other transition.
Please keep in mind that the "rand()" function used for the transition from "Normal" to "Fault" will almost certainly give a different value than the "rand()" function used for the transition from "Unplugged" to "Plugged".
I hope this helps!
Thank you,
Aditya
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!