Combining Timed and Event-based Actions in Stateflow Chart

3 ビュー (過去 30 日間)
Kevin Noll
Kevin Noll 2013 年 7 月 13 日
I am trying to build a model in StateFlow that will wait for a certain period of time after receiving an input event (function call).
My understanding is that once a chart is configured with an input event, that it will only wake up when a new input event occurs. If an input event never occurs, then my timed wait condition will never be tested and the rest of the logic in the chart will never be executed.
I have tried outputting the timed wait conditions so some other structure (Simulink or another Chart) can test the timed wait, but that just leads to the Simulink/Stateflow compiler complaining about loops or timed-to-event transitions and other errors.
Can anyone recommend a way around this?

採用された回答

Siddharth
Siddharth 2013 年 7 月 31 日
One option to do this is as follows: use a high frequency event to trigger the state machine in Stateflow. The other event (which you have already modeled) should only be used within the chart for creating the delay. If timing is very important for your application, then make sure that the time delay is a multiple of the input-event frequency.
hope that helps, Sid

その他の回答 (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