You are on page 1of 23

Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

Stateflow

R2012b Prerelease

Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

MathWorks
www. mat hwor ks. co. j p
comp. sof t -sys. mat l ab
www. mat hwor ks. co. j p/cont act _ TS. ht ml
suppor t @mat hwor ks. com
suppor t @mat hwor ks. com
doc@mat hwor ks. co. j p
ser vi ce@mat hwor ks. co. j p
ser vi ce@mat hwor ks. co. j p

Web
Newsgroup

()
()

TEL: 03-6367-6700 ()
FAX: 03-6367-6710
The MathWorks GK
107-0052 415-1

MathWorks Web

COPYRIGHT 20042012 by The MathWorks, Inc.


The software described in this document is furnished under a license agreement. The software may be used or copied
only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form
without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or
through the federal government of the United States. By accepting delivery of the Program or Documentation,
the government hereby agrees that this software or documentation qualifies as commercial computer software or
commercial computer software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72,
and DFARS 252.227-7014. Accordingly, the terms and conditions of this Agreement and only those rights specified in
this Agreement, shall pertain to and govern the use, modification, reproduction, release, performance, display, and
disclosure of the Program and Documentation by the federal government (or other entity acquiring for or through
the federal government) and shall supersede any conflicting contractual terms or conditions. If this License fails to
meet the governments needs or is inconsistent in any respect with federal procurement law, the government agrees
to return the Program and Documentation, unused, to The MathWorks, Inc.

MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www. mat hwor ks. com/t r ademar ks
for a list of additional trademarks. Other product or brand names may be trademarks or registered
trademarks of their respective holders.

MathWorks products are protected by one or more U.S. patents. Please see www. mat hwor ks. com/pat ent s
for more information.

Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

2004
2004
2005
2005
2005
2006
2006
2007
2007
2008
2008
2009
2009
2010
2010
2011
2011
2012

6
10
3
9
10
3
9
3
9
3
10
3
9
3
9
4
9
3

3
4
5
6

Version
Version
Version
Version
Version
Version
Version
Version
Version
Version
Version
Version
Version
Version
Version
Version
Version
Version

6.0 (Release 14)


6.1 (Release 14SP1)
6.2 (Release 14SP2)
6.3 (Release 14SP3)
6.0
6.4 (Release 2006a)
6.5 (Release 2006b)
6.6 (Release 2007a)
7.0 (Release 2007b)
7.1 (Release 2008a)
7.2 (Release 2008b)
7.3 (Release 2009a)
7.4 (Release 2009b)
7.5 (Release 2010a)
7.6 (Release 2010b)
7.7 (Release 2011a)
7.8 (Release 2011b)
7.9 (Release 2012a)

Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

1
. . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1-2
1-2
1-3
1-3
1-4
1-4
1-5
1-7
1-9
1-12
1-15
1-16

vi

Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

...
(p. 1-2)
(p. 1-3)
(p. 1-3)

(p. 1-4)
(p. 1-4)
(p. 1-5)
(p. 1-7)
(p. 1-9)
(p. 1-12)
(p. 1-15)
(p. 1-16)


Stateflow
MATLAB

1-2


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

25
23
10

Normal () :
Alarm () :
3
Off (): 25
Warmup (): 10
On (): 23 10

1-3


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

reference_ high

reference_ low

ALARM

CLEAR

t emp

doneWarmup

boiler_cmd

(p. 1-4)
MATLAB
addpat h ( f ul l f i l e( docr oot , ' t ool box' , ' st at ef l ow' , ' exampl es' ) )
ex_ st t _ boi l er


MATLAB
1

addpat h ( f ul l f i l e( docr oot , ' t ool box' , ' st at ef l ow' , ' exampl es' ) )
ex_ st t _ boi l er _ exer ci se

Simulink

1-4


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

2 5 Outport 1 Inport
3 [] [ ]

4 Stateflow

State Transition Table

1-5


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

MATLAB

[] [
]
2 ( )
a st at e1 Nor mal
b st at e2 Al ar m
3 3 Nor mal
a Nor mal [] []

Of f
b a 2 War mup On

(OR)
Nor mal Of f


[]

1-6


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement



boi l er _ cmd doneWar mup ( (p. 1-3)
) Normal Alarm

1-7


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

1 Enter

entry
:

Of f
ent r y:
boi l er _ cmd = 0;
doneWar mup = f al se;
War mup
ent r y:
boi l er _ cmd = 2;
On
ent r y:
boi l er _ cmd = 1;
Al ar m
ent r y:
boi l er _ cmd = 0;
2

1-8


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

(p. 1-3)

1 Nor mal

1-9


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

if
[ ALARM]

Alarm
:
a Nor mal
b ALARM

Of f War mup On
c ALARM Alar m

2 Of f

if
[ t emp <= reference_low]

Warmup
23

3 War mup

if
[ doneWar mup]

else-if
[ af t er ( 10, sec) ]
{ doneWarmup = t r ue; }

On

On

10 On

4 On

1-10


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

if
[ t emp >= r ef er ence_ hi gh]

Off
25

5 Al ar m

if
[ CLEAR]

Normal

1-11


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

MATLAB C/C++
1 MATLAB
/

1-12


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

1 Simulink [] []

2
:

:
ALARM CLEAR

2 [ ] []

ALARM CLEAR
3 [/

] [OK]

1-13


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

5 []

reference_low

referenc

t emp

ALARM

CLEAR

6
7

Simulink State Transition Table


Simulink

1-14


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

1 Simulink Simulink

2
3 [] []

1-15


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

Scope

Stateflow

1 [] []

1-16


Confidential Prerelease Documentation -- Subject to Nondisclosure Agreement

Nor mal
2 Nor mal

1-17