0

I have a very simple example. Two fans (A and B) are in a facility, representing each as a state. State Fan B will enter after 20 seconds state Fan A starts working. Therefore, after 20 sec, state FanA and state FanB will work in parallel.

How can I do this in Stateflow?

When I do parallel decomposition and assign state FanB execution in the second order, both state Fans work together simultaneously, even though I am using the after function (please neglect the L1 and x1 in the example).

model

ananvodo
  • 371
  • 5
  • 13

1 Answers1

0

For each current Fan A/Fan B parallel blocks, add an Off and On state.

For Fan A, it will immediately transition from Off to On.

For Fan B, it will monitor the state of Fan A and the transition from Off to On will be something like

[in(Fan_A.On)&&after(20,sec)]

This means that if Fan A is in the on state and 20 seconds has elapsed, take the transition.

scotty3785
  • 6,763
  • 1
  • 25
  • 35