SinelaboreRT Header Logo


It's better when it's simple!

User Tools

Site Tools


UML-Tool specific Intro

Language Backends



Designers Toolbox

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

Model-based testing of state machines 2020/02/23 19:32 Peter Mueller  
DCF77 Radio Clock 2020/02/23 19:27 Peter Mueller ,
Getting started with a Traffic Lights example on MSP430 - part 1 2020/02/23 19:26 Peter Mueller , , , ,
Astah SysML 2020/02/23 19:22 Peter Mueller  
Generate production quality code from state diagrams created with Enterprise Architect 2020/02/23 19:20 Peter Mueller  
Features 2020/02/23 19:18 Peter Mueller  
Generate efficient source code from UML state diagrams and activity diagrams! 2020/02/22 20:00 Peter Mueller  
Action disabled: revisions

Swift backend added

Swift is a new object-oriented programming language for iOS and OS X development. To generate Swift code call the code generator with the command line flag −l swift . To gener- ate a configuration file with all parameters related to the Swift code generation call the code generator as follows once:

java −jar codegen.jar −l swift −gencfg > codegen.cfg .

The events that can be sent to the machine are defined in a public enumeration.

The generator generates just one Swift class which implements the complete state machine. This has the benefit that your Swift project does not become bloated with all kinds of helper classes. This means that the generated code does not follow the usual state pattern as you might expect (if you are familiar with common design patterns). The reason is that the machine code is completely generated and no hand-coding is involved.

Separate generated from non-generated Code

Even if the state machine is fully generated this is usually only a smaller part of your application whereas the lager part is coded manually. For several reasons it is important to clearly separate generated code from non-generated code. Use one of the following possibilities to achieve this.

  • The most basic method is to put hand written code into libraries and call the library from within the state machine.
  • Generated classes can also subclass non-generated classes (base class of StateMachine). Such base classes can contain useful methods that can be called from within the generated subclasses.
  • Hand written code is located in a child class of the state machine. I.e. the state machine classes are parts of other classes.

Supported state machine features

  • States and sub-states
  • Deep - and flat hierarchy
  • Entry, Exit and Action code of states
  • Regions are supported and implemented as sub-functions called from the main state machine handler.
  • Option to define state machine signature
  • Choice pseudo-states

Example Design and Generated Code


Please note that the Swift back-end is work-in-progress. If you are interested to test and work with the code generator send me a mail and you will receive the latest beta version. Your feedback and feature requests are highly welcome!

How do you like this article?
 stars  from 3 votes

Leave your comments

Enter your comment. Wiki syntax is allowed:
If you can't read the letters on the image, download this .wav file to get them read to you.
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
wiki/news/5sep2014.txt · Last modified: 2014/09/05 18:53 by pmueller