Skip to content

Demonstration projects using finite-state machine (FSM) created with IAR Visual State

License

Notifications You must be signed in to change notification settings

iarsystems/visual-state-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphically design state machines and generate source code with IAR Visual State

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.

Pre-requisites

Running the examples

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.

image

Note

IAR provides a step-by-step guide on how to create an entire FSM.

To get started, clone this repository.

IAR Visual State

  1. In IAR Visual State, open the VisualState/Workspace.vnw file.

  2. Select the FSM mode of operation.

image

  1. Verify the system: ProjectVerify System (F10).

Note

Using the <<Complete model>> will result in ambiguous transitions when verifying the system.

  1. Simulate the system: ProjectSimulate Project (F8)

  2. Choose DebugGraphical Animation.

  3. In the Simulator window, under the Events tab, click on the events SE_RESET(), eButton1() and eButton2() to generate events that will update the graphical animation accordingly.

vs-simulator

After ensuring the simulated system do not show flaws, proceed to the demo application implementation in the desired language:

Summary

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.

Issues

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.