How to update a base workspace variable from GUI during Stateflow execution?

6 ビュー (過去 30 日間)
Siva Murugesan
Siva Murugesan 2014 年 6 月 26 日
コメント済み: Kaustubha Govind 2014 年 6 月 27 日
VS is a base workspace variable (accessible from GUI.
c is a local variable.
Transition from state 2 to state 1 should happen when VS is < 40 continuously for certain time. So in the conditional loop VS is checked until the local variable reaches 120000. In the loop execution period, if VS exceeds 40 (VS > 40) then it has to terminate the loop and jump to the same state 2.
But the VS is not changing when the loop is being executed and the loop terminates only after c reaches 120000.
VS variable if changed from GUI, its value is not getting changed in base workspace- leading to the problem.
If the variable VS is replaced as c in the loop, it works fine as per condition.
Please clarify what is wrong with this model.
  1 件のコメント
Kaustubha Govind
Kaustubha Govind 2014 年 6 月 27 日
So is the problem really that the value of VS is not getting updated in the base workspace, and not specific to the Stateflow chart? How are you updating the workspace value from the GUI? Also, how do you start the simulation - is it from a GUI callback? You may want to specify the SIM command that you use to start simulation.

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

回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by