How can i trigger a single activation of stateflow based on new receieved data?

1 回表示 (過去 30 日間)
Orel Levy
Orel Levy 2019 年 11 月 17 日
回答済み: Mark McBroom 2019 年 11 月 17 日
Hello everybody,
I have a simulink project which at certain times (not constant periods of time) generates an array of inputs I want to send to a stateflow chart.
the data is an array as follows:
[scenario_1, data_size_1,data_1,scenario_2, data_size_2,data_2].
where scenarios 1 and 2 are scalars, data_size 1 and 2 are scalars the states the following data length, and data 1 and 2 are vectors size: [data_size_m,1], where data_size_1~= data_size_2.
I first split the array into two different arrays, and then send them into the stateflow chart.
My question is how can I activate the stateflow chart only when a new input arrives?
Thanks,
Orel.

採用された回答

Mark McBroom
Mark McBroom 2019 年 11 月 17 日
Two options.
  1. You can use an event to trigger the statechart. In this case you will need Simulink logic to determine when the data is new/changed and then trigger the statechart.
  2. Second option is to use the hasChanged() stateflow function to determine when your data has changed inside the state chart.

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by