IAR Visual State is a solution for designing, simulating and verifying state machines. Beyond that, it can generate C
, C++
, C#
or Java
code correspondent to the system design. Relying on a standardized API, projects powered by IAR Visual State scale with robustness.
In this repository you will find a ready-to-use project example. Demonstration applications written in the supported languages will take advantage of the same design, relying on the code generation capabilities of IAR Visual State.
Note
This simple example was chosen to make it easy to explore the solution's capabilities. Visit the IAR Visual State Information Center, available from its Help menu, for slightly more complex examples.
- IAR Visual State V11.2.1+ (14-day trial version available)
The IAR Visual State project designs a finite-state machine (FSM) that models a simplified traffic lights device. There are two modes of operation: <full>
, which includes an additional state named "State_all" where "Red", "Yellow" and "Green" are all turned on, or <reduced>
where transitions from/to "State_all" are simply excluded.
Note
IAR provides a step-by-step guide on how to create an entire FSM.
To get started, clone this repository.
-
In IAR Visual State, open the VisualState/Workspace.vnw file.
-
Select the FSM mode of operation.
- Verify the system: Project → Verify System (F10).
Note
Using the <<Complete model>>
will result in ambiguous transitions when verifying the system.
-
Simulate the system: Project → Simulate Project (F8)
-
Choose Debug → Graphical Animation.
-
In the Simulator window, under the Events tab, click on the events
SE_RESET()
,eButton1()
andeButton2()
to generate events that will update the graphical animation accordingly.
After ensuring the simulated system do not show flaws, proceed to the demo application implementation in the desired language:
IAR Visual State is a powerful state machine design tool that you can try right now. Its standardized API brings robustness and simplifies implementation for one or more target platforms.