Free state machine tool for embedded systems

share on: 
Share on reddit
Share on linkedin
Share on twitter
Share on email
Originally published on:  
2010-11-06
Last updated on: 
QM modeling tool for state machines
Table of Contents
Tags:   

Today I wanted to let you know about a new, free, graphical tool called QM (QP-Modeler) for drawing state machines and generating production-quality embedded code. The main design objectives for QM are simplicity and minimizing the need to “fight the tool”. QM achieves this in several ways described below.

Low Ceremony

Compared to most other “high ceremony” modeling tools on the market today, QM is much simpler, code-centric, and relatively low-level. This characterization is not pejorative. It simply means that QM™ maps the design unambiguously and directly to C or C++ code, without intermediate layers of “Platform-Independent Models” (PIMs), “Platform-Specific Models” (PSMs), complex “Model-Transformations”, or “Action Languages”. All actions executed by state machines are entered into the model directly in C or C++.

QM screen shot with state property

No more "Fighting the Tool"

The primary design objective in QM™ was to respect your design decisions as much as possible and leave you in control, not only in the physical design of the generated code, but down to the exact details of arranging your states and routing your transitions. Noting is more frustrating as a tool that suddenly changes the arrangement of your diagrams, after you spent hours arranging the states and routing the transitions. QM™ will never to that.

A lot of thought went into drawing hierarchical state diagrams in QM™. In this respect, the tool is innovative and might work differently than other graphical state machine tools on the market. For example, QM does not use “pseudostates”, such as the initial pseudostate or choice point. Instead QM uses higher-level primitives of initial-transition and choice-segment, respectively. This simplifies state diagramming immensely, because you don’t need to separately position pseudostates and then connect them. Also, QM introduces a new notation for internal transitions, which allows actual drawing of internal transitions (in standard UML notation internal transitions are just text in the state body). This notation enables you to attach internal transitions and/or regular state transitions to a single choice point–something that comes up very often in practice and was never addressed well in the standard UML.

Capturing the Physical Design

The new, free QM tool from Quantum Leaps is different, because it was designed from the ground up around the code-centric approach. Unlike other graphical tools, QM gives you complete control over the generated code structure (a.k.a. the physical design), directory names, file names, and elements that go into every file. You can mix your own code with the synthesized code and use QM to generate as much or as little of the overall code as you see fit. At the low level, QM respects your graphical layout as much as possible and will not re-attach or re-route connectors, resize nodes, or adjust text annotations. You will find that you don’t need to fight the tool.

QM code generation example

Digramming Hierarchical State Machines

Even though a lot of effort went into making QM as UML-compliant, the tool is innovative and might work differently than other graphical state machine tools on the market. For example, QM does not use “pseudostates”, such as the initial pseudostate or choice point. Instead QM uses higher-level primitives of initial-transition and choice-segment, respectively. This simplifies state diagramming immensely, because you don’t need to separately position pseudostates and then connect them. Also, QM introduces a new notation for internal transitions, which allows actual drawing of internal transitions (in standard UML notation internal transitions are just text in the state body). This notation enables showing internal transitions with regular state transitions in a choice point–something that comes up very often in practice and was never addressed well in the standard UML.

How to Get It?

The QM tool is available now for a free download and free, unrestricted use from state-machine.com. I’d appreciate any comments about the tool, comparisons to other similar tools, code generation, UML, state machines, etc.

Discussion

8 Responses

  1. I know the vast majority of developers utilize Microsoft Windows as their primary development platform, but I am afraid I no longer have any Windows machines available to me to test this out. That is kind of sad because I would love to put this tool through it’s paces.

  2. The QM tool is based on the cross-platform Qt framework. Therefore, it should be relatively easy to deploy QM on all platforms supported by Qt, such as Linux and Mac OS X. I’d like to gauge the demand for different platforms. So what is it exactly that you are using? Linux? Which distribution?

    1. We’re using Linux, and assuming that you deliver a Qt library to match your app, then the distro probably doesn’t matter. For example, Qt Creator includes its own Qt libs (for the app itself) and my installation of on Ubuntus from 8.10 to 10.04 has always worked without a hitch.

  3. I’d like to see this for other platforms too.

    I use Mac OS X for most of my design work (specs, paperwork, coding, etc), and I only use my Windows machine for debugging or programming my designs. So I would love to see a Mac version that I could fit into my design flow.

Leave a Reply