SinelaboreRT Header Logo


It's better when it's simple!

User Tools

Site Tools


UML-Tool specific Intro



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


Table of Contents


22.5.2016 | Example on GitHub available now

A new fully functional vending machine example was made available for your reference. 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 message queues and can also send messages to other state machines. This is a well known design pattern to decouple objects. You can modify and compile the model yourself and play with it. It is hosted on GitHub - check it out. Read more ...

16.4.2016 | Astah SysML

The Systems Modeling Language (SysML) is general purpose visual modeling language for systems engineering applications. SysML is defined as a dialect of the Unified Modeling Language (UML) standard, and supports the specification, analysis, design, verification and validation of a broad range of systems and systems-of-systems (source: The latest version of the code generator supports now code generation from models created with the Astah SysML editor. Go on reading ...

29.3.2016 | EA12.1 Release

Sparxsystems updated EA to 12.1. There is no update of the code generator required to use this version.

2.1.2016 | Good design practice: Leader State Machine - Follower State Machines

The Unified Modeling Language (UML) allows to model quite elaborate state machines especially when using concurrent regions (aka AND states or parallel states). Concurrent regions are a powerful design measure but also have its price. Unexperienced users tend to create one big state diagram containing all parts (subsystems) of the system. Due to their own behavior and parallel execution subsystems must then be modeled as concurrent regions.

Read on to learn about an alternative solution


1.12.2015 | Maintenance Release

Upgrade of the “text edit library” which now supports folding and more. This update is recommended for users of the integrated state machine editor. Check out the Manual for more information.

19.09.2015 | Generating Activity Code from Modelio Models

There are two diagram types that can be used to express dynamic behaviour in the UML. State machine diagrams express the states of an object and the events and transitions to change the state. In contrast activity diagrams (aka flow diagrams) describe the control flow of an algorithm. Version 3.6.11 adds support for code generation from activity diagrams created with Modelio 3.3. More information is available here.

11.08.2015 | Using State-Machines and activity diagrams to realize a ModbusRTU client

This article presents a complete ModbusRTU client design based on state machines, activity diagrams and a minimal runtime environment (timers, fifos). Core functions are specified using the UML diagrams and 100% code is generated from these diagrams. If you want to learn how using state machines and activity diagrams to solve real world problems while having always an up-to-date documentation in place go on reading ...

14.6.2015 | Version 3.6.9

Fix a problem in handling EA12 xmi files containing sub-machines with entry/exit points.

1.5.2015 | Version 3.6.8

A new configuration file parameter was added and the problem with Visual Paradigm 12 exports was fixed.

15.3.2015 | Bookshelf

Recently I wrote about the design of low-power embedded systems using state-machines. Now I came across a book from Keith E. Curtis with the title Embedded Multitasking with small Microcontrollers. The book describes similar ideas in a more comprehensive way. Keith is a Principal Application Engineer for Microchip. He has written a number of articles and regularly gives a popular course on multitasking firmware design at the Embedded Systems Conference. The book and a preview is available here.

25.2.2015 | Enterprise Architect Version 12

This new version Sparx Systems changed the way how to create states and entry/do/exit actions again. First tests shows that everything works as expected and nothing was broken. If you experience problems please send a minimal example for analysis.

12.02.2015 | Using State-Machines in Low-Power Embedded Systems II

This update adds radio transmission to the example design. An interrupt driven UART interface was implemented based on the fifo code already used as event buffer. Read more here ...

02.01.2015 | Using State-Machines in Low-Power Embedded Systems

In this design example you learn how to integrate state-machines in a low power system design. It presents design principles which are useful for developers of deeply embedded systems in general and those of low power systems in particular. Basis is a MSP430F1232 controller. The software was written with TI's Code Composer Studio. The article includes the complete source code so you can check-out all details and also modify the sample yourself. Read more here ...


15.11.2014 | New Screencast

There is a new screencast that shows the very first steps required on a new Debian installation to get started with the code generator:

09.11.2014 | New version 3.6.7

This update provides many improvements in the built-in editor. Namely support for undo/redo and drag/drop. Also a new parameter for the C++ backend was added which provides an easy way for state objects to call methods of the state machine object. Take a look into the “What's new section” of the manual. Update: a screencast of the editor is available here:

14.09.2014 | Need to design state diagrams on a Unix like OS?

Most UML tools can't be used on systems running Debian Linux, FreeBSD, … Due to the fact that the integrated state machine editor is based on Java we can offer a nice solution here. Go on reading ...

5.9.2014 | Do you develop for iOS or OS X and want to use Swift?

Swift is a new object-oriented programming language for iOS and OS X development. The latest beta version of the code generator supports code generation of Swift code. Read more ...

1.9.2014 | New version 3.6.6

Astah* users watch out! The code generator now supports regions. This allows to create code from even the most complex diagrams. Read more...

20.7.2014 | New version 3.6.5

This version contains some important optimisations in the activity generator. Read more...

24.06.2014 | Reading data from an energy meter via Modbus - Activity diagram in practise

For a data logger application the voltage and real power values should be read from an energy meter using the Modbus RTU protocol. The program is regularly called and prints out the requested values. The console output is stored in a round robin database (RRD). Read more about the application and how the program is modelled as activity here ...

16.6.2014 | Built examples using MinGW on Windows

MinGW, a contraction of “Minimalist GNU for Windows”, is a minimalist development environment for native Microsoft Windows applications. Samples ending with *_win32 in the tutorial folder can now be built with MinGW. The benefit is that no separate DLLs are required for execution of the generated binaries. The other benefit is that the examples use native Win32 functions e.g. for timing and keyboard interactions which makes it easier for Windows users to modify the examples. Have fun!

16.6.2014 | New version 3.6.4

This version fixes a problem in the C++ backend. If you use transitions from the initial pseudostate to a choice pseudostate wrong code was generated in the initialise() method. Upgrade to this version if you use the C++ backend (see also the news from 18.5. if you use the c backend). It also fixes a problem that the visual editor / simulator did not start on some system because of missing icons.

7.6.2014 | Generate code from Astah* activity diagrams (new version 3.6.3)

In the latest version of the SinelaboreRT code generator support for activity diagrams was added for astah* users. astah* is a UML modeling tool written in Java and can therefore run on various platforms like Windows or Mac. In opposite to some other tools it provides a Java API for direct access of the model file. Therefore it is not necessary to export the model (e.g. in XMI format) but the SinelaboreRT code generator can directly access the model file. This makes the development cycle very fast. Read more ...

24.5.2014 | New version 3.6.2

With this new version it is now possible to generate code from activity diagrams created with UModel. Read more ...

18.5.2014 | Update to 3.6.1 if using "init to choice"

If you use “init to choice” transitions in your models upgrade to the latest version of the code generator. The generated initialisation code is not correct in all cases in earlier versions of the generator.

18.5.2014 | Updated Microwave Example using Activities

In the manual a simplified microwave oven is used to explain the generation of source code from state machine diagrams. This example was updated here to show how to generate code also from activity diagrams. Read more

18.5.2014 | New release 3.6.1

A new version is available. The latest version of the sinelabore code generator can now also generate code from activity diagrams. In addition to version 3.6 the manual was updated to explain the new features! Read more ...

28.2.2014 | New release 3.51

This release improves error handling in case of incorrect models (e.g. transition from an initial state pointing into another region etc.).

2.1.2014 | New release 3.5 of the code generator

This release adds missed features in combination with the usage of regions. It is a recommended update for all users. For more information check the release notes in the manual.


3.11.2013 | Version 3.5 beta1 with support for "init to choice"

Several users have asked for transitions going from an initial pseudo-state to a choice state. The latest beta supports this feature now. Read more ...

21.09.2013 | Version 3.4 is a bug fix release

Bug #78 was fixed. Update to this version if you use regions in regions in your models. The Enterprise Architect handbook section was updated.

21.9.2013 | Multiple instances of the same state machine?

This article explains how to run multiple instances of the state machine code and how to create own instance variables. Sounds like object orientation? Read more ...

10.9.2013 | Who needs regions in regions?

Version 3.31 supports the generation of code from even more complex models. Users who have the need for sub-machines, regions in regions etc. should check-out this latest version. See an example machine here ...

16.08.2013 | Version 3.3 with support for C# available

In an earlier version it was possible to generate C# code. This was not possible with the latest versions of the code generator, but is available now again with version 3.3. Read more ...

23.07.2013 | Version 3.2 with support for Metamill available

Metamill is a UML 2.3 modeling software, perfect for visual design of UML state diagrams. We are pleased to announce that the latest version of the code-generator now also supports C/C++/Java code generation from XMI files, exported from Metamill. For an example how state diagrams look like in Metamill take a look here. The demo version contains the fully working microwave oven example which is used in the manual.

20.04.2013 | Execution Order of Events

Now and then I get questions about the execution order of events. For UML state charts it is defined that events are handled from inside out. I.e. if there are two transitions ready to fire the transition starting from the innermost state will be taken first. Let's assume you have a state called Active with several child states. Whenever the emergency button is pressed (→ evEmergency is sent to the machine) you want the machine to leave state Active and enter state Sopped. If you use an event based model this is no problem. Just ensure that the event evEmergency is enqueued to the head of the queue.

This becomes more tricky if your model is based on conditions as triggers (see section A.4. in the handbook if you wander what conditional triggers are about). Let's assume the emergency button is connected to port pin P1.1 of our controller and your conditional trigger is defined as P1.1==TRUE/stopMotor(). In such a setup there is typically no event queue available. So we need another way to make sure that transition which might be ready to fire inside state Active prevents the handling of the outermost emergency stop transition. How to do this? There is no other way than to put the emergency condition into the guard of all the other transitions defined inside state Active. If you want to see more details: A fully worked out example is the PLCOpen function block available here.

26.2.2013 | Version 3.11 available

The simulation engine now supports regions. This is a next important step towards full support of regions. A bunch of screenshots of the microwave oven is provided here ...

26.1.2013 | Thermostat example shows the power of regions

Thermostat interface

In this example a thermostat design is shown using regions to model parallel running parts of the controller. We explain under which circumstances regions are useful to use and how the generated code looks like. Read more how you can benefit from regions in your designs here ...

3.1.2013 | Version 3.1 available

Regions are now fully supported when generating C++ code. In addition two new parameters were added that helps when using the same state names in different parent states (e.g. multiple times On/Off) and when calling multiple state machines from within one C-file (e.g. main). Read more here here ...


19.12.2012 | Good to know ...

… that the code generator works without any known problems on Windows 8/64Bit & Enterprise Architect 10. After installing Cygwin and Java the examples compiled without problems. EA10 loads existing projects, no incompatibilities have been found. Working with regions in EA10 is easier now.

07.12.2012 | Version 3.0 available

This new version brings support for Modelio an open source modeling tool based on Eclipse. For the C language backend also regions can be used now. Read more here ...

22.10.2012 | New Web-Site

The web-site has been moved from static html to a wiki basis. So far just some basic features of the wiki has been used. The new basis allows easier maintenance of the site but mainly it should help you as a user to easier find the things you look for e.g. by using the site search field. In future also other additions are possible like notifications on site changes, a user forum etc. Write me how you like the new site! Let me know what features you want to see added.

17.9.2012 | Version 2.9

This is a maintenance update and improves some details in the Editor/Simulator and the Java/C++ backend. The code input fields now support folding. Read more ...

05.8.2012 | Version 2.8 ... 2.8.3

This update of the SinelaboreRT code helps Magic Draw users to keep complex state diagrams with many transitions and/or states well-arranged. Read more ...

3.1.2012 | Version 2.7

Version 2.7 of sinelaboreRT extends the test case generation features using a breadth first search algorithm and makes the specification of multiline state action code in EA easier. Furthermore it adds support for sub-machine states in Enterprise Architect models. Read more ...


6.10.2011 | Version 2.5: New features make testing of state machines more efficient.

Version 2.5 of sinelaboreRT adds some features important for the efficient testing of state-based code.

  • Visualization of the coverage percentage in simulation mode. This tells you how good your test is.
  • Visualization of the transitions that have not been taken so far and are required to take to achieve 100% test coverage. With this info at hand you can quickly improve your test script or test procedure.
  • Generation of an Excel sheet with all the test routes required for 100% transition coverage. This sheet can be the basis for your test instruction document.
  • Possibility to attach constraints to the states. This information is added to the test route Excel sheet and informs the tester about the expected behavior in this state. This information can be informal text like “all lights off” or more formal like “relay 0 := off”. Whatever is appropriate for your application.

06.10.2011 | Model-based testing of state machines part II

The second article about model based testing explains how SinelaboreRT helps you to visualize state state machine status graphically and display coverage information. Read more ...

23.08.2011 | Model-based testing of state machines part I

This article explains how SinelaboreRT can help you to getting started with model based testing. The basis of all is of course your state machine model. Read more ...

04.07.2011 | Visual Paradigm support added

The latests version 2.41 of sinelaboreRT now supports the generation of code from Visual Paradigm for UML.

30.06.2011 | New Enterprise Architect How-To

A new EA related How-To page is available here. If you have further hints let us know and we add them.


★ 28.11.2010 | New C++ backend

In version 2.21 a new C++ backend was added. To select this backend call the code generator with the new command line flag ’-l cppx’. It has two additional features:

  • State machines are not limited to three hierarchy levels anymore but can have more levels of nesting (like cx) . This is an important feature if you want to model really complex things.
  • It is now possible to inline all entry/exit/action code into the main state machine code. So no state classes are generated at all. The new keyword ’SeparateStateClasses = No’ enables this feature.

★ 06.11.2010 | Support for Java added in version 2.2

It is now possible to generate Java code from your design. Just one class is created containing the whole logic. This has the benefit that your Java project does not become bloated with all kinds of helper classes.

history.txt · Last modified: 2017/03/18 16:38 by pmueller