Running a stateflow block as a subsystem?

3 ビュー (過去 30 日間)
Mohsen Omrani
Mohsen Omrani 2015 年 10 月 1 日
コメント済み: Mohsen Omrani 2015 年 10 月 6 日
Hello, I am designing a task using simulink and stateflow, but before connecting it to my devices to test their reaction, I am trying to simulate my device and its reactions using another stateflow block. But when I run the model I encounter this error:
Ambiguous sorted order detected due to use of triggered subsystem(s) and/or Model blocks in a loop. See Subsystem Examples in the Simulink library for valid and invalid examples of triggered subsystems
But when I try the output of the subsystem (Action) in a scope, it works just fine (I have attached a screenshot of my model). I was wondering if anyone knows how I can circumvent this error? Thanks in advance for your help.

採用された回答

Sebastian Castro
Sebastian Castro 2015 年 10 月 5 日
Since both Stateflow charts are being driven by the same clock, I would suggest combining them into a single chart. You can have the contents of each chart in their own parallel state . The "Action" signal would become local data that is written to in the first state and read from in the second.
Furthermore (or instead), if your clock is just a constant cycle, you could opt to remove the triggered execution and just change the Charts' sample time to whatever rate you're trying to recreate with the Pulse Generator block.
- Sebastian
  1 件のコメント
Mohsen Omrani
Mohsen Omrani 2015 年 10 月 6 日
Thanks for your response. I thought about that too. But I solved the problem by adding a 1 cycle delay module between the two simulators, on the way from action to The trial controller. Thanks again for your response,

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSyntax for States and Transitions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by