对状态行为进行编程
通过使用动作、事件和状态结构体对状态和转移行为进行编程,定义图的执行方式。通过定义在状态动作和转移期间发生的事件来控制逻辑。使用分层状态、并行状态和历史结点来组织图运行时行为。
主题
- Define State Behavior by Using Actions
Define behavior for state activation, while active, and when deactivating, to control system behavior at each stage of state execution.
- Supported Symbols in Actions
Special symbols available for state and transition actions.
- Create Hierarchical State Structures
Create hierarchical state structures by nesting child states inside parent states to organize complex logic and enable behavior inheritance in your chart.
- Implement Parallel States
Implement concurrent behaviors by using parallel (AND) states.
- Use Events in Stateflow Charts
Use events in Stateflow to trigger state transitions and actions for precise control over when and how states execute.
- Remember State Behavior by Using History Junctions
Track and restore previous conditions after interruptions to chart execution by using history junctions.