Matlab function calls in State chart during the 'exit' and 'transition' are not working

4 ビュー (過去 30 日間)
Varunjith Vijayan
Varunjith Vijayan 2018 年 4 月 23 日
回答済み: TAB 2018 年 4 月 26 日
1. The function calls during the 'exit' and 'transition' are not working. In the attached model, I am receiving the values 1 and 4 on the scope. The function calls for values 2 and 3 written on exit and transition are not receiving.The message is receiving on the generated code. Why the function calls written on the exit or transition are not working?
2. There is good time delay between the function call and getting the output on the output port/scope(Refer the same model). In one of the model that I work, even if the function is invoked, the output port data is changed after several step only. What might be the reason?

採用された回答

TAB
TAB 2018 年 4 月 26 日
There are lots of option for debugging the stateflow chart.
1. You can monitor activity of a super state and chech how states are activated and your data is updated. About Active State Data
2. You can watch stateflow data in debugger window. Watch Stateflow Data Values
In your model,
  • entry of state B, count=2 is not passed to ExitFunc call. So it is not visible on scope.
  • exit:state B, transition statement from B to C and entry:state C will be executed in same sample time. So even though all values are updated and passed to scope, scope will display only final value in that sample time.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComplex Logic についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by