Introduction to Stateflow with Applications

This chapter describes the basic workflow for building Stateflow truth tables to form decision making behavior, and how it works with Simulink blocks. We discuss the Truth Table block that can be added directly to a Simulink model, and the Truth Table that can be called from a Stateflow Chart block.
A Stateflow truth table represents logical decision making behavior with conditions, decisions, and actions. As in Chapter 1 where a Stateflow Chart block is inserted as a block in a Simulink model, a Truth Table block can also be added to a Simulink model to call a truth table function. A Truth Table block consists of a Condition Table column and two or more Decision columns denoted as D1, D2, and so on, and an Action Table below the Condition Table with a Description column and Action columns as shown in Table 2.1 below.
| Condition Table | |||||||
|---|---|---|---|---|---|---|---|
| Description | Condition | D1 | D2 | D3 | D4 |
| DN |
| A is logical 1 | A == 1 | T |
| ||||
| B is logical 1 | B == 1 | T |
| ||||
| C is logical 1 | C == 1 | T |
| ||||
| D is logical 1 | D == 1 | T |
| ||||
| .. | |||||||
| Action Table | |||||||
| Description | Action | t=1 |