Engee documentation

State Machines

Description

The course State Machines is designed to explore the capabilities of the State Machines library of the Engee platform. A state machine is a model of an event-driven system that switches from one mode of operation to another when certain conditions are met. The state machines allow you to build two types of models: state diagrams and flowcharts.

Each section contains a theoretical part, practical examples and self-study tasks.

Knowledge requirements: completion of the courses Welcome to Engee and Visual Simulation.

Total course time: ~3 hours.

Course program

Introduction to state machines

Using the example of a traffic light model, an initial idea of the principles of working with state machines in Engee is given.

State diagrams

Construction of state diagrams, the state diagram editor, time logic and default transitions are studied.

Variables and data in state diagrams

Input and output signals and local variables on state diagrams are studied.

Actions in state diagrams

Actions with entry, during, and exit states, as well as actions with conditions, are studied.

Executing state diagrams

An example describes in detail the step-by-step execution of the state diagram: how conditions, actions and transitions between states work.

Project: Robot vacuum cleaner

Students are invited to use the state diagram to build a model of the operation of a robot vacuum cleaner, which can be in one of four states: off, cleaning, parking and charging.

Flowcharts

The basics of building flowcharts are studied. As a practical task, it is proposed to build a model of an iterator that returns to one when the index reaches the maximum value.

Diagram hierarchy

The construction of hierarchical state diagrams is studied. As a practical task, it is proposed to construct a hierarchical state diagram describing the operation of a traffic light.