Introduction to Stateflow with Applications

Chapter 2: The Stateflow Truth Table

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.

2.1 Truth Tables in Stateflow

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.

Table 2.1: Truth Table arrangement in Stateflow

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

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Optical Tables
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.