How can I used Event-Based Temporal Logic in MATLAB/Simulink Stateflow?

1.4k Views Asked by At

I'm looking for a way to use event-based temporal logic in Simulink Stateflow.

Example: [State_1] --> [after(3,sec) && e] --> [State_2]

Scenario:

  • 0 sec: State_1 is active
  • 2 sec: e is true
  • 5 sec: State_2 is active (only after 3s of e)

Expection: [State_1] --> (after 3s of e) --> [State_2]

Result: [State_1] --> (after 3s of State_1) --> [State_2]

Is there a solution for that? I did not found one in official MathWorks documentation (MathWorks - Control Chart Execution Using Temporal Logic)

Thank you

1

There are 1 best solutions below

1
On

This is how I did it:

[State_1] --> [ e] --> [State_1_copy]--> (after 3s) --> [State_2]

combined with:

[State_1] <-- [ ~e] <-- [State_1_copy]

Entry and left action of state 1 may need to be changed depending on cases.