SinelaboreRT Header Logo

SinelaboreRT

It's better when it's simple!

User Tools

Site Tools


Sidebar

Tool Landing Pages

Examples

Designers Toolbox

How-To

Integrated state-chart editor with auto-layout

Focus on modeling and not on moving states around to create a nice looking diagram! Syntax aware text fields offer a comfortable way to specify actions, guards etc. When the diagram passed the model checker it can be directly simulated. Connect the diagram to the real hardware to monitor the state machine in action.

There are better ways to model state machines than using spread sheets!

In the past different μC manufacturers have published application notes about the benefit of using state machines for the design of embedded software. An example is the application note SLAA402 from Texas Instruments (TI). It suggests to generate source code based on a spread sheet table. Nowadays several affordable UML modeling tools are available supporting the efficient design of state machines in a graphical way. SinelaboreRT generates production quality source code from state diagrams created with many different UML tools. Give it a try!

Latest Changes

wiki:news:22may2016

Vending Machine example on GitHub

Overview

A new fully functional vending machine example is available now. It is now hosted on GitHub so you can quickly check out the model and code yourself. Link to the repository: https://github.com/sinelabore/examples

The envisioned machine is shown below.

To compile the example just call make. It is assumed that you have installed the code generator from sinelabore and the Astah* Community UML tool (locations see Makefile).

After startup you can select a product “A”, “B” or “C” by pressing one of theses buttons on your keyboard.

Then you have to insert the coins to pay for the product. Only 10Ct, 20Ct and 50Ct coins are supported. To “insert” them click “1”,“2” or “5” on your keyboard.

After you paid the product will be released and you receive back your change.

Implementation

Most of the code is automatically generated from the UML model. It contains two state machines and an activity diagram. The state machines receive events from a message queue and can also send messages to other state machines. This is a well known design pattern to decouple objects. A timer service provides basic timer services that can be used from the state machines to realize delays or repetitive activities.

Product Store State Machine

The “product_store_sm” implements a simple product store containing the goods. It is responsible to release the products by turning on the motor etc.

Vending Machine

This is the controller machine keeping things together.

Change Algorithm

This is a simple algorithm modeled with the help of an activity diagram to release the right amount of money if the user overpaid. It takes care if one coin type is empty.

Have fun!

How do you like this article?
 stars  from 2 votes

Leave your comments

Enter your comment. Wiki syntax is allowed:
59 +15 = ?
 
wiki/news/22may2016.txt · Last modified: 2017/01/07 11:45 by pmueller