Stateflow: how to add a preemptive transition? (No depth first semantic)
3 ビュー (過去 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!