What is a Finite State Machine?
A finite state machine is a conceptual machine with a finite number of states. It can be in only one of the states at any specific time. A state transition is a change in state that is caused by an input event. In response to any input event, the finite state machine might transition to a different state. Alternatively, the event has no effect and the finite state machine remains in the same state. The next state depends on the current state as well as on the input event. Optionally, an output action may result from the state transition.¹
The MLDesigner finite state machine domain includes a graphical editor and an action language for defining and managing states, transitions and interface elements. It supports the UML Statechart semantic, hierarchical states and special events, as well as key MLDesigner features such as data types and data structures, shared memory, and interaction with other design domains.
The MLDesigner FSM Domain
Features offered by the MLDesigner FSM Domain.
MLDesigner FSM Semantic
The FSM semantic provided by MLDesigner supports synchronous and asynchronous behavior, additional events, variables and parameters for various runs of simulations.
FSM Execution Semantics
The FSM scheduler responds to new events caused by arriving data on input ports or via internal or special events.
In this example, a finite state machine is used to describe a simple elevator.
The FSM model
A FSM model contains all the elements associated with a finite state machine. From the view of these model elements, a FSM model splits up into two different model types, the interface and the state transition diagram of a finite state machine.
FSM User Interface integration
MLDesigner provides special tool buttons, design objects and dialogs to model finite state machines.
FSM Design Check
MLDesigner provides you with the ability to check the FSM design for semantic errors.
FSM and Concurrency Domains
In MLDesigner, a finite state machine is always combined with other MLDesigner models, since an FSM model is always embedded into a wormhole of a concurrency domain or different MLDesigner models can be used as a slave process inside a FSM model.
Creating an FSM
A commonly used example for control-intensive software environments is the so-called "reflex game".
The Create STD File property, in the FSM Properties window, associated with MLDesigner FSM models, allows you to revert FSM models to the old format.
ANSI C Code Synthesis
The integrated ANSI C code generator enables generation of highly portable and run-time system independent C code for FSM based MLDesigner models.
¹ from: “Designing Concurrent, Distributed and Real-Time Applications with UML” by Hassan Gomaa