Skip to content

IARSystems/visual-state-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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.

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 that you can try right now. Its standardized API brings robustness and simplifies implementation for one or more target platforms.