IAR Visual State is a comprehensive solution for designing, simulating and verifying state machines. It goes beyond design by generatingC
, C++
, C#
or Java
code corresponding to the system design. With its standardized API, projects powered by IAR Visual State achieve robustness and scalability.
In this repository you will find a ready-to-use project example. Demonstration applications written in the supported languages leverage the same design, utilizing the code generation capabilities of IAR Visual State.
Note
This simple example was chosen to make it easy to explore the solution's capabilities in different languages. 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 available for immediate use. Its standardized API enhances robustness and simplifies implementation across one or more target platforms.
Follow us
on GitHub to get updates about tutorials like this and more.
For technical support contact IAR Customer Support.
For questions or suggestions related to this tutorial: try the wiki or check earlier issues. If those don't help, create a new issue with detailed information.