Page 871 - Mechatronics with Experiments
P. 871

®
                                                               ®
                                                MATLAB , SIMULINK , STATEFLOW, AND AUTO-CODE GENERATION  857
                                                        ®
                             Stateflow rather than in Simulink . In typical usage, a SF model is a block in a Simulink ®
                             model. The SF model is called the chart. The chart is used to represent various modes of
                             operation.
                                  The mathematical modeling paradigm in Stateflow is based on the concept of oper-
                             ating modes. The operating modes are called the states, in which various logics are imple-
                             mented and are called actions.The transitions between these states are based on some
                             events and/or conditions.
                             The programmer needs to express the problem at hand in these terms;
                                1. states,
                                2. actions,
                                3. transitions and junctions,
                                4. conditions,
                                5. events,
                                6. data.
                             Events and data are non-graphical objects of Stateflow, whereas the others are graphical
                             objects.
                                                              ®
                                  Stateflow is started from MATLAB command window by typing (Figure A.31)

                             >> stateflow
                             This brings up the “sflib” (Stateflow library) window. The development tools for Stateflow
                             include the
                                1. Stateflow Editor
                                2. Model Explorer, and
                                3. Debugger.































                                                                 ®
                             FIGURE A.31: Stateflow windows in MATLAB .
   866   867   868   869   870   871   872   873   874   875   876